Repository navigation
Crate vyrn chain
Amp edited this page Nov 18, 2026
·
1 revision
crates/vyrn-chain · layer 7 of spec 11 §1.4 · not pinned (11 §1.3)
CHAIN mode. On main the crate holds the L1-facing bridge codec and the balance SMT. It turns finalized VYRN state into the bytes that Ethereum L1 and light clients check, and it checks the bytes they produce. Every format is fixed by a spec section and by the conformance vectors in contracts/vectors/. Those vectors were computed without this crate.
- 09 §6.2, §6.5, §6.7: EIP-712
Post,Unpause,SignerSetdigests and 4-of-5 bridge-key signatures - 09 §6.2: the keccak256 withdrawal Merkle tree (OpenZeppelin
StandardMerkleTree) - 09 §9.3: the BLAKE3 sparse Merkle tree, depth 256, with
AccountLeafandBalanceLeaf - 09 §6.4, §6.5:
Checkpoint→Post, and the guardian's veto decision - 01 §14.11: Keccak-256 only in the L1-facing code (RustCrypto
sha3, 11 §2.2)
| Type | Role |
|---|---|
eip712::Domain, Post, Unpause, SignerSet
|
EIP-712 typed data and digests |
eip712::count_sigs, SigError
|
4-of-5 signature check, with the contract's errors in the contract's order |
Withdrawal (wdtree) |
Withdrawal leaf of the keccak256 tree |
Smt, Proof
|
BLAKE3 SMT; Proof::root returns None on a sibling/bitmap mismatch |
AccountLeaf, BalanceLeaf
|
Leaf encodings of contracts/README §Leaf encoding |
Checkpoint, build_post
|
Finalized state → Post
|
Guardian, Verdict, VetoReason
|
The guardian's review of a post |
keccak256, keccak256_parts
|
Ethereum Keccak-256 |
Replica, Epochs (traits) |
What the crate reads from vyrn-replica and vyrn-epoch
|
Implemented (partial)
- Bridge codec, withdrawal tree, SMT and guardian review are implemented.
Epochsis implemented overvyrn_epoch::BridgeSignerTable, which owns the bridge signer table (moved there in PR #42). - Crate doc: "
vyrn-replicais not a dependency yet, so [Replica] has no implementation here; wiring it is a follow-up." - Crate doc, "Not implemented yet": "Session open and wallet signatures (§5.2),
K_seq/K_comderivation and TESLA disclosure (§5.3–§5.4, §5.10), the order LtHash (§9.4),StateCommitencoding andCommitCertverification (§9.5), the log hash chain (§9.2), slashing evidence (§8), forced inclusion (§7), L1 deposit attestation (§6.3), and theAllocLeaf/SessionLeaf/OperatorLeaflayouts." - Tests: 8
#[test]in tests/vectors.rs, against contracts/vectors.
| Crates | |
|---|---|
Code (Cargo.toml) |
vyrn-types, vyrn-crypto, vyrn-epoch; external k256, sha3
|
| 11 §1.4 |
vyrn-replica, vyrn-epoch
|
Missing: vyrn-replica. Cargo.toml says: "vyrn-replica is not a dependency yet: this crate reads it through its own Replica trait in src/lib.rs until it lands."
Overview
Working on VYRN
Spec
- 00 Index
- 01 Conventions
- 02 Requirements
- 03 Architecture
- 04 Protocol
- 05 Engine
- 06 Platform
- 07 Replication
- 08 Epochs
- 09 Chain
- 10 Accounts, Risk, MD
- 11 Build
- 12 Commitment
- 13 Availability
- 14 Envelope
Engine crates
Other crates
- vyrn-nic
- vyrn-log
- vyrn-data
- vyrn-consensus
- vyrn-replica
- vyrn-epoch
- vyrn-chain
- vyrn-md
- vyrn-sim
- vyrn-bench
Binaries
- vyrn-seq (stub)
- vyrn-validator (stub)
- vyrn-admin
Outside Rust
Reflects main at a9f0d61.