Alea documentation
Alea verifies drand BN254 BLS signatures inside a Solana program via a single CPI call. These docs cover the on-chain program and both SDKs.
cargo add alea-sdknpm install @alea-drand/sdkDevnet is live at ALEAydzHd4cN2EWcdHKp4hehAE4B88b16gqVtVqsck2U. Mainnet deploy is next.
Integrating
Section titled “Integrating” Introduction What Alea is, what drand is, what you get and what you don't. Read first if you haven't picked a randomness primitive yet.
Install Both SDKs, the rustc-lag constraint pin, and a sanity check that prints the devnet program ID.
Rust SDK cpi::verify, AleaVerify accounts struct, is_round_recent, config_pda, and the full AleaError enum.
TypeScript SDK getVerifiedRandomness, verifyDrandBeacon, fetchBeacon, browser wallet support, every exported constant and type.
CPI Integration Guide A full lottery — Rust program and TypeScript client — that buys tickets, settles via Alea, and pays the winner.
Common Pitfalls The sharp edges you will hit during integration: Anchor 0.30 + web3.js 1.98, rustc lag, CU budget, preflight.
Understanding
Section titled “Understanding” Architecture The verify call from caller to return data. Why the program holds almost no state. Where the CU budget goes.
drand & BN254 Background on drand's threshold-BLS model and why evmnet runs on BN254 instead of BLS12-381.
Security model Threat model, non-goals, and the exact trust boundary between drand, the deployer, and the on-chain program.
Comparison Alea vs ORAO VRF, Switchboard randomness, and DIY commit-reveal. Includes where Alea is the wrong tool.
Testing & guarantees Fuzz coverage, cross-verification against kevincharm's reference, reproducible build SHA. Plus the gaps — no external audit.
Responsible disclosure How to report a vulnerability, what's in scope, the 90-day coordination window.
Reference
Section titled “Reference” Cluster addresses Program IDs, PDA seeds, binary SHA, deploy transactions. The things you paste into your code.
Program interface Raw on-chain instruction contract — discriminator, account order, data layout. For non-Anchor integrators and custom indexers.
Errors Searchable by error code. Each row links to the layer that throws it — verify, init, or Anchor framework.
Where Alea lives
Section titled “Where Alea lives”| Where | What |
|---|---|
| Devnet program | ALEAydzHd4cN2EWcdHKp4hehAE4B88b16gqVtVqsck2U |
| Rust crate | alea-sdk on crates.io |
| npm package | @alea-drand/sdk |
| Source | github.com/alea-drand/alea |
| Releases | github.com/alea-drand/alea/releases |
| Drand chain | api.drand.sh (evmnet, 3-second cadence) |
| Contributing | CONTRIBUTING.md |
License is Apache 2.0. Alea is a public good — no commercial tier exists and none is planned.
Alea exists because of prior work by Randamu (who runs drand and built the BN254 Solana prototype that never shipped) and kevincharm (who wrote the BN254 scheme into drand itself and built Anyrand, the EVM version of what Alea does). Full acknowledgments on Comparison.