Expand description
The design philosophy underlying power_house is pedagogical, yet mathematically rigorous.
Each module encapsulates a discrete concept in modern computational complexity theory,
illustrating how modest abstractions compose into a cohesive proof infrastructure.
This crate aspires to bridge gaps between theoretical exposition and practical engineering, serving both as a didactic resource and a foundation for future cryptographic research.
§power_house
Power-House is a Rust crate that showcases a set of cryptographic and verification primitives inspired by interactive proof systems, the sum-check protocol and the ALIEN theorem. The goal of this crate is to demonstrate how one can build powerful proof systems and consensus logic with a minimal dependency surface while still leaning on modern hash primitives for tamper evidence.
§Features
- Finite field arithmetic via the
Fieldtype. - Sum-check demonstration: the
sumcheckmodule contains functions to compute the true sum of a small bivariate polynomial over the Boolean hypercube, build a one-shot claim, and verify it with negligible soundness error. - Pseudorandom number generator (PRNG): the
prngmodule exposes a compact BLAKE2b-256 expander that derives deterministic Fiat–Shamir challenges from transcripts. It serves as a stand-in for a verifiable random function (VRF) when exploring protocol blueprints. - Byzantine-fault-tolerant consensus: the
consensusmodule provides a trivial consensus primitive that takes a set of binary votes and returns whether the threshold has been met. It is intended as a pedagogical example of how one might aggregate prover responses. - ALIEN theorem blueprint: the
alienmodule outlines, through documentation and type stubs, how one could combine interactive proofs, VRF randomness, consensus and provability logic into a globally verifiable proof ledger. This module is meant to illustrate the ideas described in the ALIEN theorem statement included in the problem statement, but it does not implement a full ledger.
§Usage
The following example demonstrates how to compute and verify a sum-check claim for the demo polynomial \f$,f(x_1,x_2) = x_1 + x_2 + 2 x_1 x_2,) modulo a small prime \f$p,) using this crate:
use power_house::{Field, sumcheck::SumClaim};
// Choose a prime field of order 101.
let field = Field::new(101);
// Prover creates an honest claim with default round count k=8.
let claim = SumClaim::prove_demo(&field, 8);
// The verifier checks that the claim is valid.
assert!(claim.verify_demo());The crate can be extended with richer protocols by building on these primitives. It is intentionally minimal and does not offer a complete blockchain or proof ledger implementation.
Re-exports§
pub use alien::compute_fold_digest;pub use alien::julian_genesis_anchor;pub use alien::julian_genesis_hash;pub use alien::reconcile_anchors;pub use alien::reconcile_anchors_with_quorum;pub use alien::AnchorMetadata;pub use alien::AnchorVote;pub use alien::EntryAnchor;pub use alien::LedgerAnchor;pub use alien::Proof;pub use alien::ProofKind;pub use alien::ProofLedger;pub use alien::Statement;pub use alien::JULIAN_GENESIS_STATEMENT;pub use consensus::consensus;pub use sumcheck::ChainedSumProof;pub use sumcheck::GeneralSumClaim;pub use sumcheck::GeneralSumProof;pub use sumcheck::ProofStats;pub use sumcheck::SumClaim;
Modules§
- alien
- The design philosophy underlying
power_houseis pedagogical, yet mathematically rigorous. Each module encapsulates a discrete concept in modern computational complexity theory, illustrating how modest abstractions compose into a cohesive proof infrastructure. - consensus
- The design philosophy underlying
power_houseis pedagogical, yet mathematically rigorous. Each module encapsulates a discrete concept in modern computational complexity theory, illustrating how modest abstractions compose into a cohesive proof infrastructure. - economics
- Token economics scaffolding for DA layer monetization.
- rollup
- Rollup integration with Groth16 verification. Circuit: next = prev + tx_root (Fr) plus Pedersen Merkle inclusion of tx_root into pedersen_root bytes (public).
- sumcheck
- The design philosophy underlying
power_houseis pedagogical, yet mathematically rigorous. Each module encapsulates a discrete concept in modern computational complexity theory, illustrating how modest abstractions compose into a cohesive proof infrastructure.
Structs§
- Field
- A finite field defined by an odd prime modulus.
- LogRecord
Metadata - Metadata captured from optional comment lines in a ledger log file.
- Merkle
Proof - Merkle inclusion proof for a single transcript digest.
- Merkle
Proof Node - Describes a sibling hash encountered while walking a Merkle tree.
- Multilinear
Polynomial - Represents an n-variate multilinear polynomial via its values on
{0,1}ⁿ. - Parsed
LogFile - Parsed contents of a ledger log file.
- Simple
Prng - A deterministic stream generator derived from BLAKE2b-256.
- Streaming
Polynomial - Streaming representation of a multilinear polynomial over a Boolean hypercube.
- Transcript
- Stateful helper that derives challenges from a recorded transcript.
Functions§
- build_
merkle_ proof - Constructs an inclusion proof for the leaf at
indexwithinleaves. - merkle_
root - Computes the Merkle root for the provided leaf digests.
- parse_
log_ file - Parses a ledger log file, tolerating optional comment lines that begin with
#. - parse_
transcript_ record - Parses a transcript record and returns its components and stored hash.
- read_
fold_ digest_ hint - Attempts to load a fold digest hint from
fold_digest.txtinsidedir. - transcript_
digest - Computes the deterministic digest used for transcript records.
- transcript_
digest_ from_ hex - Parses a lowercase or uppercase hex string into a transcript digest.
- transcript_
digest_ to_ hex - Converts a digest into a lowercase hex string.
- verify_
merkle_ proof - Checks whether the proof recomputes the advertised Merkle root.
- verify_
transcript_ lines - Verifies that a transcript record matches its stored hash digest.
- write_
text_ series - Writes a text file to
base_dir/prefix_index.txtusing the provided lines. - write_
transcript_ record - Writes a transcript record using the provided writer function.
Type Aliases§
- Transcript
Digest - Fixed-width transcript digest.