The whole surface, one page.
On-chain instructions, Rust helper crates, and the TypeScript SDK. Stable contracts — anything that ships under 0.1.x stays in 0.x.
On-chain instructions (Anchor program)
The yoroi_core program exposes the verify path for every primitive. Each instruction is one CPI line from your caller.
rustpub fn verify_aggregate( ctx: Context<VerifyAggregate>, agg_pubkey: [u8; 96], message: Vec<u8>, agg_signature: [u8; 48], ) -> Result<()>; pub fn verify_threshold( ctx: Context<VerifyThreshold>, committee_id: u64, threshold_sig: [u8; 48], message: Vec<u8>, ) -> Result<()>; pub fn verify_vrf( ctx: Context<VerifyVrf>, seed: Vec<u8>, proof: [u8; 48], expected_output: [u8; 64], ) -> Result<()>;
Rust crates
Each library can be used standalone (no_std host) or wired into the on-chain program. Same trait surface in both contexts.
rustuse yoroi_bls::{ generate_keypair, sign, aggregate_signatures, aggregate_pubkeys, verify_aggregate, }; let kp = generate_keypair(&seed)?; let sig = sign(&kp.secret, b"message"); let agg = aggregate_signatures(&[sig_a, sig_b, sig_c])?; let agg_pub = aggregate_pubkeys(&[pk_a, pk_b, pk_c])?; verify_aggregate(&agg_pub, b"message", &agg)?;
yoroi_blsBLS aggregate sign + verify, BatchVerifieryoroi_thresholdShamir split + combine, t-of-n threshold signingyoroi_dkgPedersen DKG round-1/round-2 helpersyoroi_vrfBLS-VRF prove + verify, aggregate-VRF helpersyoroi_ibeBoneh-Franklin IBE setup / extract / encrypt / decryptyoroi_pqWOTS+ keygen / sign / verify behind SignatureScheme
TypeScript SDK
Browser + Node. WASM bindings to the Rust crates, plus an Anchor client for the on-chain program.
tsimport { generateKeypair, sign, aggregate, AggregateBuilder, YoroiClient, } from "@yoroi/sdk"; const builder = new AggregateBuilder(); signers.forEach((kp, idx) => builder.push({ pubkey: kp.public, signature: sign(kp.secret, msg), index: idx }), ); const bundle = builder.finalize(msg); const client = new YoroiClient({ rpcUrl: RPC }); const tx = client.buildVerifyAggregateTx({ payer: signer.publicKey, committeeId: new BN(1), bundle, }); await client.sendTx(tx, signer);
Error codes
On-chain errors surface through Anchor's ProgramError. Mapping below stays stable across patch releases.
6000InvalidSignatureaggregate signature failed pairing check6001InvalidPublicKeyG1 / G2 decoding failed6002SyscallUnavailableSIMD-0388 not yet activated on runtime6003CommitteeMismatchsigners do not match registered committee6004ThresholdNotMett-of-n quorum not reached6005StaleProofVRF proof against expired seed window