Skip to main content

Security & Threat Model

Overview​

This document describes the trust assumptions, known attack vectors, and limitations of rng.dev. Read this carefully before using the beacon for any application.

The 1-Second Beacon​

rng.dev generates new randomness every second using 8 independent blockchains:

PropertyValue
Cadence1 second
SourcesAptos, Arbitrum, Base, Bitcoin, Cardano, Ethereum, Solana, Sui
VerificationFull — all inputs public, recomputable

Security Model​

rng.dev provides two layers of security:

1. Economic Security: Manipulating blockchain consensus requires $80B+ in capital across all chains. No rational attacker spends billions to influence outcomes worth a fraction of that cost.

2. Information-Theoretic Security: Transaction IDs are determined by global user behavior — which users submit transactions, when, and with what parameters. Predicting TXIDs requires predicting the behavior of millions of independent actors. This is not a computational problem; it's an information problem that cannot be solved regardless of resources.


Trust Assumptions​

The beacon assumes:

  1. At least 1 honest data source from 16 — Each of 8 chains contributes 2 data points (block hash + TXID). If even one is unpredictable, the output is unpredictable.
  2. SHA3-256 behaves as a random oracle (standard cryptographic assumption)
  3. RPC providers return authentic blockchain data (verifiable on block explorers)

What We Do NOT Require​

  • Trust in the beacon operator (all inputs are public and verifiable)
  • Trust in any single blockchain (we use 8)
  • Trust in any single RPC provider (multiple fallbacks)
  • Trust in most sources being honest (1 of 16 is sufficient)

Attack Analysis​

AttackDescriptionFeasibilityMitigation
Last-revealerMiner withholds block to influence outputLowMulti-source diversity; attacker must control finalization across multiple chains
GrindingMiner tries multiple blocks to find favorable hashVery LowCost scales with number of sources; economically impractical
RPC manipulationMalicious provider returns fake dataLowMultiple fallback providers; verifiable on explorers
Single-source compromiseOne blockchain's randomness is biasedLow15 other data points still contribute; only need 1 honest source
Operator manipulationWe publish favorable resultsLowAll inputs stored; anyone can verify
PredictionObserve inputs before outputLowTXID-based unpredictability

Last-Revealer Attack​

A miner who discovers a block could theoretically:

  1. Observe the current beacon inputs
  2. Calculate what the output would be with their block
  3. Decide whether to publish or withhold

Why this is impractical:

  • Bitcoin uses 6-confirmation finality (~60 min lag)
  • Attacker would need to hold a valid block for ~1 hour
  • Block becomes stale and worthless if not published quickly
  • Must simultaneously influence multiple chains

Grinding Attack​

An attacker could try to:

  1. Generate many candidate blocks
  2. Calculate beacon output for each
  3. Publish the most favorable one

Why this is impractical:

  • Must generate valid blocks (requires hash power or stake)
  • Must do this for multiple chains simultaneously
  • Cost: millions of dollars for minimal influence
  • Each additional source exponentially increases difficulty

Economic Analysis​

Manipulating the beacon requires influencing blockchain block production:

Cost per chain (approximate):

ChainConsensusCost to Guarantee BlockNotes
BitcoinPoW$10-20 billion (51% hashrate)600 EH/s network; requires millions of ASICs
EthereumPoS~$50B+ (33% stake)33M ETH staked; slashing destroys attacker's stake
SolanaPoS~$10B+ (33% stake)Leader selection based on stake weight
CardanoPoS~$5B+ (33% stake)Probabilistic block production
AptosPoS~$2B+ (33% stake)BFT consensus
SuiPoS~$2B+ (33% stake)Narwhal/Bullshark consensus

Note on Bitcoin (Proof of Work): You cannot simply "pay to mine a block." You must either:

  1. Control >50% of global hashrate (~$15B in hardware + $50M/month electricity), OR
  2. Get lucky with your existing hashrate (probabilistic, not guaranteed)

Note on PoS chains: The capital requirements must be:

  1. Purchased — Buying 33% of staked ETH (~$50B) would cause massive market impact
  2. Locked — Staked capital is frozen for weeks/months
  3. Slashable — Misbehavior results in automatic destruction of stake

Multi-chain multiplication:

The beacon combines 8 independent chains. To control the output:

Chains ControlledInfluence on OutputCapital Required
1 of 8Minimal (~12% of input)$1B+ (smallest chain)
2 of 8Partial (~25% of input)$2B+
4 of 8Significant (~50% of input)$10B+
8 of 8Full control$80B+ (all chains)

Expected value is always negative:

EV = P(success) × Value(manipulation) - Cost(attack)

For a $1,000,000 prize (controlling 1 chain):
EV = 0.125 × $1,000,000 - $1,000,000,000 = -$999,875,000

For a $100,000,000 prize (controlling all 8 chains):
EV = 1.0 × $100,000,000 - $80,000,000,000 = -$79,900,000,000

Bottom line: Influencing even ONE chain requires $1B+ in locked capital. Ethereum alone requires $50B+ locked and at risk of slashing. Controlling all 8 chains would require $80B+.


Transaction ID Security​

All modes use transaction IDs (TXIDs) as an entropy layer. This provides security guarantees independent of block production control.

Why TXIDs Are Unpredictable​

Transaction IDs derive from customer transactions — submitted by users around the world, not by block producers. Even an attacker who controls block production cannot predict or control these inputs:

PropertyBlock HashTransaction ID
OriginBlock producerExternal users/customers
ControlProducer can grind (expensive)Producer has no control
PredictionPossible with enough hashpower/stakeImpossible — depends on global user behavior
ManipulationRequires controlling consensusRequires controlling customer behavior worldwide

Attack Scenarios​

Scenario 1: Attacker controls block production on one chain

With block hashes alone, this provides ~17% influence over the combined output. With TXIDs:

Block hash: Attacker can influence
TXID in position 1: Attacker CANNOT predict

Result: Even controlling the chain, the TXID is determined by:
- Which customer transactions arrive
- When they arrive
- Network propagation timing
- Mempool ordering (varies by node)

Scenario 2: Attacker controls block production on ALL eight chains ($80B+)

Even with nation-state resources controlling all eight blockchains:

All 8 block hashes: Attacker can influence
All 8 TXIDs: Attacker still CANNOT predict

The first transaction in each block depends on:
- Global customer activity (cannot be predicted or controlled)
- Mempool state at block creation time
- Network propagation across thousands of nodes
- Fee market dynamics (which TX pays most)

Why TXIDs Cannot Be Controlled​

Unlike block hashes, transaction IDs are determined by:

  1. Transaction content — The sender, recipient, amount, data, nonce, signature
  2. Cryptographic hash — TXID = hash(transaction data)
  3. User decisions — When users choose to transact

An attacker would need to:

  • Predict when customers worldwide will submit transactions
  • Predict what amounts, recipients, and data they will include
  • Control which transaction arrives first at block production time

This is information-theoretically impossible.

Transaction Selection Rules​

ChainSelectionRationale
Bitcoin2nd transaction1st is always coinbase (miner-controlled)
Ethereum1st transactionUser transactions start at index 0
Solana1st non-vote transactionVote transactions are validator-controlled
Aptos1st transactionUser transactions start at index 0
Cardano1st transactionUser transactions start at index 0
Sui1st transactionUser transactions start at index 0

Verification Model​

Self-Verification​

rng.dev is designed for trustless verification. You don't need to trust us or any third party:

  1. All inputs are public — Block hashes and TXIDs from 8 blockchains
  2. All inputs are stored — Every round includes the exact inputs used
  3. Algorithm is deterministic — SHA3-256 sequential mixing, fully specified
  4. Anyone can recompute — Fetch inputs, run the algorithm, compare output

This means:

  • You can verify any round yourself using public blockchain data
  • No trusted third party required
  • No special cryptographic knowledge needed
  • Just check block explorers and run a hash function

Validator Network (Planned)​

We're building a distributed validator network where independent operators continuously verify rounds. This will provide:

  • Continuous monitoring — Automated verification of every round
  • Public attestations — Signed statements from known entities
  • Anomaly detection — Immediate alerts if verification fails

Self-hosted beacon operators can participate as validators. See Self-Hosted Guide for details.


Known Limitations​

LimitationImpactMitigation
Blockchain dependenciesIf all 8 chains fail, no randomnessExtremely unlikely; degraded mode with partial sources
RPC provider trustMust trust at least one provider per sourceMultiple fallbacks; users can verify on explorers
Statistical verification onlyCannot prove randomness, only show "no detected bias"Continuous statistical testing; all inputs verifiable

Appropriate Uses​

Use CaseWhy It Works
Lotteries & gamblingUnbiasable, verifiable, audit trail
Real-time gaming1-second cadence, fully verifiable
Scientific experimentsReproducible, transparent random seeds
AI/ML trainingConsistent random initialization across runs
Governance selectionFair jury/audit sampling
Games & entertainmentTransparent randomness players can verify

Do NOT Use For​

Use CaseWhy NotAlternative
Cryptographic key generationWrong tool — keys require local entropy/dev/urandom, hardware RNG
National lotteriesRegulatory requirementsJurisdiction-certified vendors
Air-gapped systemsRequires network accessHardware RNG, local entropy

Self-Hosted: Optional Entropy Sources​

Self-hosted operators can optionally add additional entropy sources. See Self-Hosted Guide for configuration.

drand Integration (Optional)​

For operators with specific regulatory requirements for threshold BLS signatures:

optional_sources:
drand:
enabled: true
network: "quicknet"
wait_for_next: true

Hardware Entropy (Optional)​

For air-gapped or high-security deployments:

optional_sources:
hardware:
enabled: true
device: "/dev/hwrng"

Incident Response​

If we detect anomalies:

  1. Statistical tests fail → Investigate, may pause generation
  2. Source unavailable → Continue with remaining sources, flag in API
  3. Multiple sources unavailable → Halt generation, notify users
  4. Suspected manipulation → Full audit, public disclosure

Historical incidents will be documented in our GitHub repository.


Responsible Disclosure​

Found a security issue? Report it through GitHub Security Advisories.

We appreciate responsible disclosure and will acknowledge researchers who help improve security.


Further Reading​