Sub-Tangle Offline Merges, $O(1)$ Hardware-Anchored Finality, and Dafny-Verified State Transitions on an ETH-Restaked Cosmos AppChain
Author: Solymus Protocol Research Status: Architecture proposal (v0.1) Audience: EigenLayer researchers, ZK engineers, formal-verification practitioners
0. Abstract
We describe the protocol-level architecture of Solymus, an ETH-restaked Cosmos AppChain targeting consumer payment finality. Three results:
- A deterministic state-diff canonicalization protocol that reduces HSM signing from
$O(N)$ telemetry operations to exactly one$O(1)$ temporal anchoring operation per micro-epoch, without weakening FIPS 140-3 compliance. - A Merkle-merge DAG (the Sub-Tangle) that resolves peer-to-peer offline payment forks with commutative, idempotent, balance-conserving semantics.
- Machine-checked proofs in Microsoft Dafny, discharged by Z3: 5 modules, 43 theorems, 112 verification conditions, no unsolved obligations.
The execution-layer primitive at the center of the rail is patent-protected and out of scope here.
1. Architecture Context
Solymus is not a Layer 1, and it is not a rollup. It is a Cosmos SDK v0.50 AppChain with CometBFT v0.38 BFT consensus, restaked against Ethereum via an EigenLayer AVS. Economic security is borrowed from Ethereum; execution and micro-epoch sealing stay sovereign; validator admission is gated by hardware-root attestation (TPM 2.0 + AWS Nitro Enclave NSM).
| Layer | Primitive |
|---|---|
| Settlement anchor |
SolymusAVSRegistry.sol on Ethereum L1 |
| Economic security | EigenLayer AVS, operator |
| Execution | Cosmos SDK modules (x/microepoch, x/feeburn, x/signer, x/attestation) |
| Consensus | CometBFT, 1-second block time |
| Validator admission | TPM 2.0 quote + Nitro NSM attestation document |
| Signing | FIPS 204 ML-DSA-65 (PQC) with ECDSA-SHA256 fallback seam |
The AVS contract receives one Merkle root commitment per micro-epoch via a Go relayer. The only property we rely on here is that the on-chain anchor is strictly monotone in epoch id.
2. The Hardware Signing Bottleneck
2.1 The $O(N)$ trap
A naive edge telemetry rail exposes a FIPS 140-3 HSM to per-event signing. For a 1-second-finality consumer rail,
2.2 The $O(1)$ reduction
Our reduction hinges on deterministic state-diff canonicalization via RFC 8785 JSON Canonicalization Scheme (JCS). The insight: if
Let
where
regardless of
This is what makes hardware-rooted sub-second finality tractable under FIPS 140-3. Marginal certified-entropy cost per user tends to zero as
3. The Sub-Tangle: Merkle-Merge DAG for Offline Forks
3.1 Problem statement
Two devices
3.2 Construction
Define a Sub-Tangle
The Merkle root
3.3 Required properties
For safety, the merge must satisfy four invariants:
I1 and I2 fall out of set-union algebra. I3 (double-spend detection is order-independent) and I4 (no balance underflow under any merge order) are the load-bearing claims.
3.4 Double-spend surface
A conflicting spend manifests as two signed payloads from the same sender over overlapping nonces. A canonical walk over the merged set yields a partition
4. Machine-Checked Proofs
4.1 Why Dafny + Z3
Unit tests cover instances; proofs cover universals. We wanted merge-order independence over all input permutations, not over a Hypothesis-sampled subset. Microsoft Dafny + Z3 gives us uninterpreted function support (opaque over the hash model), first-class proof-carrying code, and the same toolchain used inside AWS, Microsoft, and Intel verification pipelines.
4.2 Metrics
| Module | Theorems | VCs | Scope |
|---|---|---|---|
feeburn.dfy |
7 | 23 | Burn monotonicity, pool conservation |
microepoch.dfy |
7 | 23 | Chain-hash continuity, no forks at height |
subtangle.dfy |
10 | 28 | I1..I4 + composite |
passkey.dfy |
7 | 22 | Address derivation determinism, domain separation |
zk-merkle.dfy |
6 | 16 | SNARK |
| Total | 43 | 112 | 5 modules, Z3-discharged |
All 112 VCs discharge on Dafny 4.11.0 + Z3 under --allow-warnings=false. {:axiom} is restricted to opaque deterministic hash models and is never used over ledger logic. The ledger proofs therefore survive any concrete hash instantiation that satisfies determinism.
4.3 Sub-Tangle commutativity, in Dafny
ghost function {:axiom} LeafHash(n: Node): bytes32 ghost function {:axiom} MerkleOver(leaves: set<bytes32>): bytes32 function Merge(A: SubTangle, B: SubTangle): SubTangle { SubTangle(A.nodes + B.nodes) } lemma MergeCommutes(A: SubTangle, B: SubTangle) ensures Merge(A, B) == Merge(B, A) { // set union is commutative by extensionality } lemma MerkleRootCommutes(A: SubTangle, B: SubTangle) ensures MerkleOver(Leaves(Merge(A, B))) == MerkleOver(Leaves(Merge(B, A))) { MergeCommutes(A, B); // LeafHash is deterministic under {:axiom}; // set equality of leaves implies MerkleOver equality. } lemma DetectMergeOrderIndependent(A: SubTangle, B: SubTangle) ensures Detect(Merge(A, B)) == Detect(Merge(B, A)) lemma Conservation(T: SubTangle, s: Account) requires ValidBalances(T) ensures AppliedDebits(T, s) <= Balance(T, s)
{:axiom} on LeafHash and MerkleOver models the hash as an uninterpreted deterministic function. Equal inputs yield equal outputs by Dafny semantics, which is enough for I1, I2, and I3 with no commitment to a specific collision-resistance assumption. I4 is proved by induction over the canonical walk, with ValidBalances as the loop invariant.
5. What This Buys
-
HSM compliance survives scale. The
$O(1)$ reduction lets a FIPS 140-3 HSM anchor a sub-second consumer rail without queueing. - Offline forks are provably safe. I1..I4 hold over every merge order; no adversary forces a double-apply by re-ordering payload arrival.
- Restaking gets a clean slashing surface. Slashing evidence is a pure function of the anchored Merkle root, not of local history.
- The proof boundary is honest. Axioms are confined to the hash oracle; ledger logic is fully mechanized.
6. Open Questions
- Slashing wiring under Pectra-era EigenLayer
AllocationManager: currently an event-only hook pending API stabilization. - Trusted-setup ceremony for the Groth16 prover anchored to the public-signal binding already proved in
zk-merkle.dfy. Structural binding is shipped; crypto strength of the underlying prover is the remaining swap. - Formalizing relayer invariants (strict monotonicity, crash-safe checkpoint, gap-free catch-up, poison-pill stop) into a Dafny module parallel to
subtangle.dfy, closing the last non-Dafny safety surface between the AppChain and the L1 anchor.
Feedback on the merge algebra and on the JCS-based HSM reduction is specifically requested.


























