
Product
Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.
@orangecheck/vote-core
Advanced tools
OC Vote protocol core — canonicalization, content-addressed ids, weight modes, deterministic tally. Reference implementation of oc-vote-protocol v0.
Reference implementation of oc-vote-protocol v0 — stake-weighted, sybil-resistant, offline-tallyable polls on Bitcoin.
npm i @orangecheck/vote-core
canonicalize(obj) / canonicalBytes(obj) — RFC 8785 canonicalization with the spec's options[] preservation rule.pollId(poll) / ballotId(ballot) / revealId(reveal) — content-addressed ids via SHA-256 of canonical bytes with sig.value emptied.commit(pollId, voter, option) — secret-mode commitment per SPEC §4.4.voterWeight({ utxos, snapshot, minSats, minDays, mode, params }) — three canonical weight modes: one_per_address, sats, sats_days.tally({ poll, ballots, utxosAt, revealedOptions?, verifyBip322?, skipSignatures? }) — deterministic pure tally function.Poll, Ballot, Reveal, TallyResult.The package ships vitest suite that loads the canonical fixtures from oc-vote-protocol/test-vectors/ and asserts byte-identical canonical bytes, ids, commits, and tally output for all five vectors (v01 minimal public, v02 sats-weighted, v03 sats_days with cap, v04 vote-change, v05 secret-ballot).
import { tally, pollId } from '@orangecheck/vote-core';
const result = await tally({
poll,
ballots,
utxosAt: (addr, snapshotBlock) => fetchUtxos(addr, snapshotBlock),
skipSignatures: false,
verifyBip322: async (address, message, sig) => {
const { Verifier } = await import('bip322-js');
return Verifier.verifySignature(address, message, sig);
},
});
// { state: 'tallied', snapshot_block: 900000, turnout: {...}, tallies: {...} }
import { ballotId } from '@orangecheck/vote-core';
const draft = {
v: 0, kind: 'oc-vote/ballot',
poll_id, voter, option: 'yes',
attestation_id: null, secret: null,
created_at: new Date().toISOString().replace(/\.\d+Z$/, 'Z'),
sig: { alg: 'bip322', pubkey: voter, value: '' },
} as const;
const id = ballotId(draft);
// ask your wallet to BIP-322 sign `id`, then set sig.value
import { commit } from '@orangecheck/vote-core';
const c = commit(pollId, voterAddr, 'yes');
// embed `c` in ballot.secret.commit; encrypt the option id to poll.reveal_pk
// via an oc-lock envelope in ballot.secret.envelope.
See oc-vote-protocol/WHY.md for the design rationale.
orangecheck/oc-vote-protocol@orangecheck/lock-core (encryption primitive; composed here for secret-ballot envelopes)MIT.
FAQs
OC Vote protocol core — canonicalization, content-addressed ids, weight modes, deterministic tally. Reference implementation of oc-vote-protocol v0.
The npm package @orangecheck/vote-core receives a total of 9 weekly downloads. As such, @orangecheck/vote-core popularity was classified as not popular.
We found that @orangecheck/vote-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.

Research
More than 140 Mastra npm packages were compromised in a supply chain attack that used a typosquatted dependency to deliver a cross-platform infostealer during installation.

Research
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.