Skip to content

Xm0onh/NIROPoK-PostQuantum-Sidechain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NIROPoK Post-Quantum

How to run a node

RUST_LOG=info cargo run

HashChain Mechanism

This project utilizes a hash chain to ensure fairness and unpredictability in block production.

  1. Generation of Hash Chain:
    At the start of each epoch, a new hash chain is generated by invoking HashChain::new().
    This chain is a sequence of precomputed hash values.

  2. Commitment via Final Hash:
    The last hash in the chain serves as a commitment for the epoch.
    This commitment is broadcast to the network as a HashChainCom message, ensuring all nodes share a common, verifiable reference.

  3. Randomness for Block Proposal:
    During mining events, a specific hash is selected from the chain based on the epoch's progression.
    This hash acts as a seed, determining which node is eligible to propose the next block.
    By relying on a precommitted hash chain, the protocol prevents tampering and manipulation.

  4. Verification Process:
    As epochs progress, parts of the hash chain are revealed, allowing nodes to verify that the selection process aligns with the initial commitment.
    This mechanism ensures that the randomness and fairness in the block production process are maintained across the peer-to-peer network.

Generate Circuit

cargo run --bin circuits

stat -f"%z bytes" proof.bin

Generate Proof

expander-exec \
  --fiat-shamir-hash SHA256 \
  --poly-commitment-scheme Raw \
  prove \
    --circuit-file   circuit.txt \
    --witness-file   witness.txt \
    --output-proof-file proof.bin

Verify

expander-exec verify \
  --circuit-file   circuit.txt \
  --witness-file   witness.txt \
  --input-proof-file proof.bin

Benchmarking the verification time:

hyperfine --warmup 3 'expander-exec verify \
  --circuit-file circuit.txt \
  --witness-file witness.txt \
  --input-proof-file proof.bin'

About

NIROPoK-Based Post-Quantum Sidechain Design

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages