RandProofRandProof
Whitepaper

7. RandProofRNG: Verifiable Randomness Engine

[Layer 1: Core]

7.1 Entropy Pipeline

async function generatePoFREntropy(eventId, requestBlock) {
// Source 1: DRAND beacon
const drand = await fetchDrandRound(requestBlock);
await verifyDrandSignature(drand.round, drand.signature, DRAND_PUBLIC_KEY);
// Source 2: NIST Randomness Beacon
const nist = await fetchNistBeacon(requestBlock);
await verifyNistSignature(nist.value, nist.signature, NIST_PUBLIC_KEY);
// Source 3: Participant commit-reveal
const commitXOR = await getCommitRevealXOR(eventId);
// Source 4: Chain-native entropy
const blockEntropy = await getBlockEntropy(requestBlock);
// Source 5: Block timestamp
const timestamp = await getBlockTimestamp(requestBlock);
// Aggregate all fifteen sources (Sources 1-15)
// Note: v1.0 implementation below shows first 5 sources for clarity. Production code fetches all 15.\
const seed = keccak256(encode([drand.output, nist.value, blockEntropy, commitXOR, timestamp, /* + Sources 6-15 */ eventId]));
// Generate BLS partial signature
// M includes chainId, contract address, and all 15 entropy inputs (see Section 6.4)
const partialSig = blsSign(KEEPER_KEY_SHARE, M);
return { seed, partialSig, drand, nist, commitXOR, blockEntropy, timestamp };
}

On this page