Skip to content

jacklevin74/photon-oracle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

PHOTON v2 — Quantum Entropy Oracle

Invented & Commissioned by: Masked Gaming (@MaskedandDegen) EFCfT1VrW9dHHQKauc3XUmjdDYBMcoEwQELVFS5uxNAB

Built by: Theo (@xxen_bot) Date: 2026-03-17 Network: X1 Mainnet


PHOTON is a true quantum random number generator oracle on X1 Mainnet.

It pulls genuine quantum entropy from five independent sources, mixes them with BLAKE3, and pushes verifiable 32-byte entropy rounds on-chain every 60 seconds. Any X1 program can consume PHOTON entropy for trustless randomness.

Security guarantee: The output is cryptographically unpredictable as long as any single source is uncompromised. An attacker would need to simultaneously control ANU, NIST, ID Quantique, LFDR, and your CPU hardware — an effectively impossible task.


Five Entropy Sources

# Source Type Method Free?
1 ANU QRNG True quantum Vacuum photon shot noise (Australian National University)
2 NIST Beacon True quantum 512-bit chained pulse from NIST quantum hardware
3 QUANTIS Cloud True quantum Photon detection via ID Quantique beam splitter
4 LFDR Beacon True quantum European quantum network beacon
5 CPU RDRAND Hardware entropy Thermal noise in silicon transistors (Intel/AMD) Built-in

Plus: os.urandom(32) — kernel CSPRNG always included as final safety layer.


Entropy Mixing Formula

anu_source_hash = BLAKE3(anu_bytes)   ← auditable ANU contribution

entropy_hash = BLAKE3(
    anu_bytes    ||    ← vacuum photon fluctuations
    nist_bytes   ||    ← NIST quantum hardware pulse
    quantis_bytes ||   ← photon beam splitter detection
    lfdr_bytes   ||    ← European quantum beacon
    rdrand_bytes ||    ← CPU thermal noise
    blockhash    ||    ← X1 on-chain freshness anchor
    os.urandom(32)     ← local CSPRNG (always)
)

Why concatenation? BLAKE3 is a collision-resistant PRF. Even if 4 of 5 quantum sources are somehow compromised, the single remaining source makes the output unpredictable.


Architecture

┌─────────────────────────────────────────────────────────────────┐
│                        PHOTON v2 Daemon                         │
│                                                                 │
│  ANU QRNG (Australia)  ──┐                                      │
│  NIST Beacon (USA)     ──┤                                      │
│  QUANTIS Cloud (CH)    ──┼── BLAKE3 mix ── submit_entropy tx ──►│──► X1 Mainnet
│  LFDR Beacon (EU)      ──┤                                      │
│  CPU RDRAND            ──┤                                      │
│  X1 blockhash          ──┘                                      │
└─────────────────────────────────────────────────────────────────┘

On-chain:
  OracleState PDA     — authority + round counter
  EntropyRound PDAs   — 256-slot ring buffer, keyed by round_id % 256

On-Chain Interface

Reading entropy (free)

// seeds = ["entropy_round", (latest_round_id % 256).to_le_bytes()]
// OracleState PDA seeds = ["oracle_state"]

pub struct EntropyRound {
    pub round_id:        u64,
    pub entropy_hash:    [u8; 32],  // ← use this as your randomness
    pub anu_source_hash: [u8; 32],  // auditable ANU contribution
    pub nist_pulse_id:   u64,
    pub slot:            u64,
    pub timestamp:       i64,
    pub sources_bitmap:  u8,        // bitmask of active sources
}

Requesting a random value (0.001 SOL)

Call request_random(seed: Vec<u8>) — returns:

SHA256(seed || entropy_hash || round_id_le64)

Deterministic, verifiable by anyone.

Sources bitmap

Bit Value Source
0 0x01 ANU QRNG
1 0x02 NIST Beacon
2 0x04 Local OS
3 0x08 QUANTIS
4 0x10 LFDR
5 0x20 CPU RDRAND

Deployment

Prerequisites

# Rust + Anchor
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install --git https://github.com/coral-xyz/anchor anchor-cli

# Solana CLI
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
solana config set --url https://rpc.mainnet.x1.xyz

# Python 3.10+
cd daemon && pip install -r requirements.txt

Build & Deploy

# 1. Build
cd program
anchor build

# 2. Get program ID
solana address -k target/deploy/photon_oracle-keypair.json

# 3. Update declare_id! in src/lib.rs, then rebuild
anchor build

# 4. Deploy to X1 Mainnet
anchor deploy --provider.cluster https://rpc.mainnet.x1.xyz

# 5. One-time initialize
# Call initialize() via Anchor client or CLI

Run the Daemon

cd daemon
cp .env.example .env
# Edit .env — set ORACLE_KEYPAIR_PATH and PROGRAM_ID

python photon_daemon.py

Sample output:

2026-03-17T17:00:00Z PHOTON v2 daemon starting
2026-03-17T17:00:00Z   Entropy sources : ANU + NIST + QUANTIS + LFDR + RDRAND + local
2026-03-17T17:00:00Z   RPC             : https://rpc.mainnet.x1.xyz
2026-03-17T17:00:02Z round=0      hash=a3f2e1b0 sources=[ANU+NIST+QUANTIS+LFDR+RDRAND+local] sig=4xKP...
2026-03-17T17:01:02Z round=1      hash=7c9d3a22 sources=[ANU+NIST+QUANTIS+LFDR+RDRAND+local] sig=8mNQ...

CLI

python photon_cli.py latest           # latest entropy round
python photon_cli.py history 10       # last 10 rounds
python photon_cli.py request "seed"   # request random (0.001 SOL)

Integrating PHOTON in Your Program

// Add to your Cargo.toml if importing EntropyRound directly
// Or just read the PDA account data manually

pub fn use_photon_randomness(ctx: Context<YourCtx>) -> Result<()> {
    let entropy = &ctx.accounts.entropy_round;
    
    // Mix with your app-specific seed for isolation
    let mut hasher = anchor_lang::solana_program::hash::Hasher::default();
    hasher.hash(&entropy.entropy_hash);
    hasher.hashv(&[b"my-app-name", &ctx.accounts.user.key().to_bytes()]);
    let result = hasher.result();
    
    // result.to_bytes() is your application-specific random seed
    Ok(())
}

Resource Usage

Resource Usage
RAM ~8–12 MB
CPU < 0.1% at 60s intervals
Network ~8 KB/min (5 HTTP requests + RPC)
Storage Logs only

Runs on a 512 MB VPS or Raspberry Pi.


Files

photon-oracle/
├── program/
│   ├── src/lib.rs          ← Anchor program (Rust)
│   └── Cargo.toml
├── daemon/
│   ├── photon_daemon.py    ← v2 daemon (5 entropy sources)
│   ├── photon_cli.py       ← CLI tool
│   ├── requirements.txt
│   └── .env.example
└── README.md

Attribution

PHOTON was invented and commissioned by Masked Gaming as part of the Masked Labs / Cyberdyne portfolio.

Built by Theo (@xxen_bot) on X1 Mainnet — the fastest EVM-compatible blockchain.


MIT License — free to use and integrate. Credit appreciated.

About

PHOTON v2 — Quantum Entropy Oracle on X1 Mainnet. Invented by Masked Gaming (@MaskedandDegen). 5 true quantum sources: ANU QRNG + NIST Beacon + QUANTIS + LFDR + CPU RDRAND.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors