v0 (v2.5.0-rfc) · archived baseline · superseded
Part 3: Settlement Contract, Atomic Treasury zBTC, Plasma & Peg-Free Rails
Document Class: Normative L1 Settlement, Tokenomics & Peg-Free Application Specification (v2.5.0-rfc)
Upstream Baselines: Project Zeno/spec/SPEC.md v1.6.0, GENERALIZED-AUTHORIZATION-BRIDGE-FRAMEWORK.md v0.3.2, MINTED Settlement Extension v0.1.1 (subject to Upstream Amendments in SPEC.md §6), go-zenon origin/release/0.0.11-rc1 (f19955f) / origin/dev (770e893)
Contract Address: SettlementContract (spec/05 §5.1)
Numeric Oracle: scripts/verify_spec_bounds.py.
1. Atomic Treasury Pre-Mint Issuance Model (Resolving C-11, R2-M2, R3-L11, A-MINT-1)
In go-zenon release/dev, embedded contracts execute inside per-account AccountVmContexts (vm/vm_context/interfaces.go:12-37), committed peer storage is read-only (chain/store/momentum.go:51), dev:vm/vm.go:204-226 requires embedded→embedded ContractSends to target a valid ABI method (data-less sends like dev:vm/embedded/implementation/token.go:163-172 fail applySend), and TokenContract.Burn permits Owner to burn even when IsBurnable == false (dev:vm/embedded/implementation/token.go:330).
- Step 1 —
SettlementContract.InitiateMintedToken("ZenonBitcoin", "zBTC", domain, 8, 21_000_000*10^8)(Governance, attaches1 ZNN):- Emits descendant
ContractSend(1 ZNN) callingTokenContract.IssueMinted(...). TokenContract.IssueMintedrequiressendBlock.Address == types.SettlementContract, exemptscheckTokenregexes (dev:vm/embedded/implementation/token.go:40,43) ONLY for this method, setsTotalSupply = MaxSupply = 21M*10^8,IsMintable = false,IsBurnable = false,Owner = types.SettlementContract, and emits descendantContractSendwithData = ABISettlement.PackMethod("ReceiveTreasury").SettlementContract.ReceiveTreasury(): EnforcessendBlock.Address == types.TokenContract,TreasuryInitialized == 0(single-use),sendBlock.Amount == 21_000_000 * 10^8, and stores immutableTreasuryZts = sendBlock.TokenStandard+TreasuryInitialized = 1.- Sealing
TokenContract:TokenContract.UpdateTokenANDTokenContract.Burnreject iftokenInfo.Owner == types.SettlementContract.
- Emits descendant
- Step 2 —
SettlementContract.BindMintedAsset(domainId, zbtcZts, ...)(Governance, after full exit window):- Verifies
TreasuryInitialized == 1 && zbtcZts == TreasuryZts, reads committedTokenContractstore, verifiesSettlementContract.Balance(zbtcZts) == MaxSupply, enforces tuple/asset injectivity, initializesAssetRegistry+CustodyRecord, and appends initialGOVERNANCE_ADD_BINDING(0x0E).
- Verifies
- Single-Receive Atomic Transfers:
- Mint (
MINTED_LOCK_V1,MINTED_REFUND_V1): DescendantContractSendfrom treasury to user (dev:vm/vm.go:204-247). - Burn (
RequestPegOut): User sendszBTCtoSettlementContract; returned atomically to treasury. - Exact L1 Invariant:
SettlementContract.Balance(zBTC) + CustodyRecord.RepresentationOutstanding == 21,000,000 * 10^8.
- Mint (
2. SettlementContract Storage, Per-Domain Input Sequencing & Never-Reused Batches
2.1 Storage Key Prefixes (SettlementContract Account Storage)
| Prefix | Entity | Storage Key | Contents |
|---|---|---|---|
0x01 | DomainRecord | 0x01 || domainId(u32) | domainClass, runtimeKind, stfSpecHash, genesisStateRoot(32B), inputSource, execProfile, foreignProfile, proposerPolicy, finalityModel, status(0=ACTIVE|1=PAUSED), dispatchFrozenByBatch(u64, 0=none), lastFinalizedTipHeight(u64), nextBatchId(u64, starts at 1), lineageHeadBatchId(u64, 0=genesis sentinel), aggregateInFlightMint(u256) |
0x02 | GlobalInputCounter | 0x02 | nextGlobalInputIndex(u64) (global monotonic across ALL domains) |
0x03 | DomainInputBySeq | 0x03 || domainId(u32) || domainInputSeq(u64) | Contiguous per-domain record: globalInputIndex(u64) || inputKind(u8: 6|7) || inputHash(32B) || sourceBlockHash(32B) || momentumTs(u64) || spamDepositZnn(u64) || submitterAddr(20B) (+ system payload for kind=7) |
0x04 | DomainCursor | 0x04 || domainId(u32) | nextDomainInputSeq(u64), lastBatchedSeq(u64), lastFinalizedSeq(u64) |
0x05 | BatchCommitment | 0x05 || domainId(u32) || batchId(u64) | BatchCommitmentV3 + state(0=CHALLENGE_OPEN|1=FINALIZED|2=REJECTED) + challengeDeadlineTs(u64) + activeChallengeSessions(u32) + activeChallengeCommits(u32) + dupRefundsClaimed(u16 <= 16) |
0x06 | AssetRegistry | 0x06 || domainId(u32) || assetId(32B) | custodyMode, foreignChainId, foreignAssetRef, decimalsPolicy, maxRepresentationSupply, maxBatchMint, maxInFlightMintPerExecutor, maxAggregateInFlightMint, activeChainBindingHash, activeVaultUtxoCount(u64), unrotatedVaultCount(u64) (R5-H3), bindingState, drainStopBitcoinHeight, drainGuardianExpiryTs, status |
0x07 | AssetReverseIndex | 0x07 || assetId(32B) | domainId(u32) |
0x08 | ForeignTupleIndex | 0x08 || SHA3-256(domainId || foreignChainId || foreignAssetRef) | assetId(32B) |
0x09 | CustodyRecord | 0x09 || domainId(u32) || assetId(32B) | ESCROW fields (0); representationOutstanding, pendingForeignRelease, verifiedLockedCollateral, cumulativeProvenLocks, cumulativeMinted, cumulativeBurned, cumulativeReleased, cumulativeRefunded |
0x0A | VaultUtxoSet | 0x0A || domainId(u32) || outpoint(36B) | amount(u64) || setupChainBindingHash(32B) || epochEntries[<=2]{epochId(u16), eligibleOperatorsBitmask(u64), takeTxidsSmtRoot(32B)} || status(0=UNASSIGNED|1=ASSIGNED|2=PENDING_TRAP|3=RELEASED|4=RECOVERED|5=QUARANTINED|6=ORPHANED) || quarantineReason(0=NONE|1=RECOVERY|2=UNROTATED) || assignedOutboxId(32B) (R6-L3) |
0x0B | ClaimPolicy | 0x0B || domainId(u32) || policyVersion(u32) | purpose, activationHeight, exitDelay, exact 3-capability table |
0x0C | ProcessedClaim | 0x0C || claimId(32B) | u8(1) (permanent) |
0x0D | ProcessedForeignEvent | 0x0D || domainId(u32) || foreignEventId(32B) | u8(1) (permanent) |
0x0E | ClaimReceipt | 0x0E || claimId(32B) | handlerId(32B) || effectHash(32B) || dispatchHeight(u64) || custodyDigest(32B) |
0x0F | PegOutRecord | 0x0F || outboxId(32B) | Immutable authorization + assignedVaultOutpoint(36B) + setupChainBindingHash(32B) + slotOperatorId(u32) + lastLapsedOperatorId(u32) + slotClaimZenonTs(u64) + slotExpiryBtcHeight(u64) + slotBondLockedZnn(u64) + reservedEpochLane(u16,u8) + reimbursementOperatorId(u32) + reimbursementRoundId(u32) + one-way state(0=PENDING|1=RELEASED|2=REFUNDED) (R6-M2/M4/M5) |
0x10 | PegOutNonce | 0x10 || domainId(u32) | u64 |
0x11 | ExecutorRegistration | 0x11 || domainId(u32) || executorAddr(20B) | znnBond(u256), qsrBond(u256), inFlightMintExposure(u256), status, unbondUnlockTs(u64) |
0x12 | OperatorRegistry | 0x12 || domainId(u32) || operatorId(u32) | operatorAddr(20B), znnBond(u256 >= 31,500 ZNN), qsrBond(u256), active(u8), slashed(u8) + OperatorLaneState[opId||u16(epochId)||lane] = {anchorCutoffTs, anchorExpiryTs, nextUnusedIdx(0..8), nextEligibleKickoffTs, pendingReservations(u16), retired(u8)} + RoundUsed[opId||roundId] (R6-M2) |
0x13 | VerifierRegistry | 0x13 || verifierRef(32B) | kind, verifyingKeyId, active |
0x14 | ChallengeSession | 0x14 || sessionId(32B) | Multi-Tx Witness accumulator (batchId, batchTraceRoot, openTs, expiryTs = openTs + 43200s) + CommitChallenge (commitHash, revealDeadlineTs = commitTs + 3600s) |
0x15 | InputDepositClaimed | 0x15 || domainId(u32) || domainInputSeq(u64) | u8(1) |
0x16 | DeferredLockQueue | 0x16 || claimId(32B) | Validated lock claim deferred during pause / supply cap / G-21 / missed-rotation pause |
0x17 | PeripheryConfig | 0x17 | governanceContract, guardianMultisig, treasuryInitialized, treasuryZts, minOperatorBondZnn, softDelaySecs, exitWindowSecs, inputSpamDepositZnn, challengeDepositZnn |
2.2 Canonical BatchCommitmentV3 & Inductive Per-Leaf Accumulators (328 B)
ChallengeAggregation is DELETED. Every batch-level aggregate is committed via complete mathematical induction inside StepTraceLeaf[0..inputCount-1] (MaxBatchInputs = 256, traceRoot depth <= 8, 328 B fixed per leaf), and RelayClaim routes directly through traceRoot:
StepTraceLeaf (328 bytes fixed) :=
domainInputSeq : u64 // MUST equal batch.FirstInputSeq + stepIndex
preRoot : bytes32
postRoot : bytes32
stepClaimsRoot : bytes32 // domain-separated Merkle root of claim emitted by THIS step (0..1 claim)
stepClaimCount : u8 // 0 or 1
stepLockAmount : u256
stepReleaseAmount : u256
stepNonDelivAmount : u256
stepHalted : u8
stepHaltedHeight : u64
cumLockAmount : u256
cumReleaseAmount : u256
cumNonDelivAmount : u256
cumClaimCount : u32
haltedSoFar : u8
haltedHeightSoFar : u64
observedTipAfter : u64
stepError : u8 // 0=ok, 1=malformed error, 2=idempotent duplicate no-op (capped <=16 global/batch)
BatchCommitmentV3 :=
protocolVersion : u16 (2)
commitmentVersion : u16 (3)
domainId : u32
batchId : u64 // NEVER reused monotonic ID
parentBatchId : u64 // MUST equal domain.lineageHeadBatchId (0 = genesis sentinel)
policyVersion : u32
firstInputSeq : u64
lastInputSeq : u64 // == firstInputSeq + inputCount - 1
inputCount : u32 // 1 <= inputCount <= MaxBatchInputs (256)
preStateRoot : bytes32
postStateRoot : bytes32
traceRoot : bytes32
inputRoot : bytes32
receiptRoot : bytes32
eventRoot : bytes32
outboxRoot : bytes32 // MUST be zero32 for AUTHORIZATION domain
observedChainHeight : u64
domainHalted : u8
haltedReorgHeight : u64
daHash : bytes32
daMode : u8
executorId : bytes20
submittedAtHeight : u64
submittedAtTs : u64
assetFlowSummary : Bytes // MUST be empty
claimEffectSummary : List<ClaimEffectEntry>
proofData : Bytes // MUST be empty for OPTIMISTIC at submit
3. Atomic State Transitions, Reachability G-21 & Aligned Cross-Store Vault State Machine
3.1 SubmitInput — ALWAYS Open & Global Duplicate Refund Cap
SubmitInput is accepted in BOTH ACTIVE AND PAUSED, requires len(payload) <= 15,600 B and 0.1 ZNN spam deposit, assigns monotonic globalInputIndex AND contiguous per-domain domainInputSeq, and supports trustless ClaimInputDepositRefund (stepError == 0 always refundable; stepError == 2 refundable while batch.DupRefundsClaimed < 16 globally; stepError == 1 forfeited).
3.2 SubmitBatch, FinalizeBatch, Bounded Sessions & Commit-Reveal
SubmitBatch: EnforcesRANDOM_BACKUP, monotonicbatchId,parentBatchId == lineageHeadBatchId,PreStateRootchaining,finalLeafbinding, per-executor +10.0 BTCaggregate in-flight caps, and dispatch-onlydispatchFrozenByBatch.FinalizeBatch: Permitted inACTIVEANDPAUSED(Shadow Mode); exemptsbatchId == dispatchFrozenByBatch; rejects whileActiveChallengeSessions > 0 || ActiveChallengeCommits > 0or parent unfinalized; releasesinFlightMintExposure&aggregateInFlightMint.- Challenges: Mandatory
ChallengeDepositZnn(10%executor bond),CommitChallenge(T_reveal = 1h, 6-momentum priority),ChallengeContinuity(1,700 B), 1-txChallengeStep, bounded Multi-Tx Sessions (T_session = 12h,UploadWitnessProof = 8,676 B@ depth 256, re-verifies(State, traceRoot, leaf)atExecuteChallenge), permissionless expiry cleanup, andRefundRejectedBatchChallengerefunding deposits on ancestor-rejected descendants.
3.3 Complete Aligned Cross-Store Vault State Machine (R6-M2, R6-M3, R6-L3, R6-L4)
| Event / Call | Domain TrackedVaultRecord (0x08) | Settlement VaultUtxoSet (0x0A) | Guard / Invariant |
|---|---|---|---|
BTC_LOCK_PROOF → MINTED_LOCK_V1 | ∅ → ACTIVE (activeEpochs=[{g, smtRoot}]) | ∅ → UNASSIGNED (quarantineReason=NONE, epochEntries=[{g, mask, smtRoot}]) | Enforces latency-aware G-21 + unrotatedVaultCount == 0 |
VAULT_GRAPH_EPOCH_ADDED (0x0D) → SyncVaultGraphEpoch | ACTIVE/RELEASED → same (adds g+1); QUARANTINED → ACTIVE | UNASSIGNED/ASSIGNED/RELEASED(ReimbRound==0) → same (adds g+1); QUARANTINED → UNASSIGNED/ASSIGNED (decrements unrotatedVaultCount-- iff quarantineReason == UNROTATED!) | Strict no-dup / <= 2 active epochs (R6-L2); RECOVERY vaults NEVER touch unrotatedVaultCount (R6-L3)! |
QuarantineExpiredVault(outpoint) (now >= T_cutoff(g) + 60h) | (n/a) | UNASSIGNED|ASSIGNED → QUARANTINED (quarantineReason=UNROTATED, unrotatedVaultCount++) | Permissionless after 60h finalization grace (day 48.5) if vault lacks live next-epoch graph; pauses new mints (R6-L3, R6-L4) |
RequestPegOut | (unchanged: ACTIVE) | UNASSIGNED → ASSIGNED | Requires status == UNASSIGNED AND >= 1 live epoch e with eligible op having ReachableRounds(e, now + 3.0d) - pendingReservations >= 1 (R6-M2) |
BTC_RELEASE_PROOF → MINTED_RELEASE_V1 | ACTIVE → RELEASED; PENDING_TRAP/RECOVERED preserved (ADMITS FOREIGN_RELEASE!) | ASSIGNED → RELEASED (or leaves PENDING_TRAP/RECOVERED for RepointTrappedPegOut!) | Keys ReimbursementOperator strictly from domain FOREIGN_RELEASE.operatorId (R6-M4); NEVER strands honest fronter (R6-M3)! |
RepointTrappedPegOut(outboxId, newVaultOutpoint) (R6-M3) | (reads re-graphed RecoveryVaultUTXO or UNASSIGNED vault) | Re-points PegOutRecord.assignedVaultOutpoint from PENDING_TRAP|RECOVERED vault to re-graphed recovery vault or next UNASSIGNED vault | Permissionless once PegOutRecord.State == RELEASED && ReimbursementRoundId == 0 && oldVault ∈ {PENDING_TRAP, RECOVERED} |
BTC_NON_DELIVERY_PROOF → MINTED_REFUND_V1 | (unchanged) | ASSIGNED → UNASSIGNED (IF PENDING_TRAP, RECOVERED, or QUARANTINED, refunds user ONLY — NEVER overwrites vault status!) | Releases any held lane reservation; eliminates overwrite (R5-M3, R6-L3) |
BTC_VAULT_SPEND_PROOF (SMT inclusion) → SyncPendingTrapVault | ACTIVE → PENDING_TRAP(h_spend) | UNASSIGNED/ASSIGNED → PENDING_TRAP | Mirrors PENDING_TRAP to Settlement so vault is non-assignable |
BTC_VAULT_RECOVERY_PROOF → SyncRecoveredVaultOutpoint | ACTIVE|PENDING_TRAP → RECOVERED; inserts recOut as QUARANTINED; writes RecoveredVaultMap[old] = {recOut, opId, roundId} | old → RECOVERED; inserts recOut as QUARANTINED (reason=RECOVERY) (does NOT touch unrotatedVaultCount!) | Cancels PENDING_TRAP with zero halt; recOut unassignable until SyncVaultGraphEpoch! |
SyncOrphanedVaultOutpoint(outboxId_X, oldOutpoint_d) | (reads RecoveredVaultMap[oldOutpoint_d]) | RELEASED → ORPHANED | Deterministically checks RecoveredVaultMap[d].(opId, roundId) == PegOutRecord[X].(reimbursementOpId, reimbursementRoundId) |
3.4 RelayClaim, Latency-Aware G-21, Anti-Censorship Fronting & Reimbursement (R6-M2..M5, R6-L6, R6-L8)
RelayClaim(MINTED_LOCK_V1): Enforces Latency-Aware, Reservation-Aware Dynamic Reachable Capacity (G-21,R6-M2,R6-L9): requiresunrotatedVaultCount == 0ANDActiveVaultUTXOs + 1 <= Σ_{m,e,l} ReachableRounds(m, e, l, now + 3.0d) - 25, whereReachableRounds = 0if lane retired ormax(now + 3.0d, nextEligibleKickoffTs) > anchorCutoffTs, elsemax(0, min(8 - nextUnusedIdx, floor((anchorCutoffTs - max(now + 3.0d, nextEligibleKickoffTs)) / 5.5d) + 1) - pendingReservations)! Defers smoothly toDeferredLockQueueduring pause / supply cap / the disclosed~5.0dpre-epoch window before geng+1registers (DispatchDeferredLock).ClaimFrontingSlot(outboxId, epochId, lane)(R6-M2,R6-M4,R6-M5):- Requires
PegOutRecord.State == PENDINGANDVaultUtxoSet[assignedOutpoint].status == ASSIGNED. - Single-Authority Expiry (
R6-M4): Rejects whilepo.SlotOperatorId != 0 && (frontier.TimestampUnix < po.SlotClaimZenonTs + 14_400 || DomainRecord.LastFinalizedTipHeight < po.SlotExpiryBtcHeight)! - Anti-Censorship (
R6-M5): If a previous slot expired unfulfilled, slashes100%of the lapsed holder'sSlotBondZnn = 500 ZNN(SlashLapsedSlotalso callable permissionlessly!), decrements the lapsed holder'spendingReservations--, recordspo.LastLapsedOperatorId = oldSlotOp, and rejects consecutive re-claim bypo.LastLapsedOperatorId(while any other eligible operator exists)! - Reservation & Latency Check (
R6-M2): Requires caller is eligible inepochIdonassignedOutpoint,ReachableRounds(caller, epochId, lane, now + 3.0d) >= 1(accounting forpendingReservations), locks500 ZNNSlotBondZnn, incrementslane.pendingReservations++, records{SlotOperatorId, SlotClaimZenonTs, SlotExpiryBtcHeight = LastFinalizedTipHeight + 24, reservedEpochLane}, and appendsPEGOUT_SLOT_CLAIMED(0x0A).
- Requires
RegisterOperatorRound(opId, roundId, bondOutpoint, anchorCutoffTs, anchorExpiryTs, commSig)(R6-L6): RequiresOperatorBond_ZNN >= MinOperatorBondZnn(31,500 ZNN),epoch := epoch(roundId) < 4096,anchorExpiryTs == finalityEpochStartTs(epoch) + 58 days(exact equality!),anchorCutoffTs == anchorExpiryTs - 12 days, verifiedCommitteeIdentityKeysig; initializesOperatorLaneStateand appendsOPERATOR_ROUND_REGISTERED(0x0B).SyncRetiredLane(domainId, opId, epochId, lane, batchId, smtProof): Permissionless; verifiesLaneRetired[opId || u16(epochId) || lane] == 1(0x11) under finalizedpostStateRootand setsOperatorLaneState.retired = 1, zeroing remaining capacity!ClaimReimbursementSlot(outboxId, opId, roundId)(R6-M2,R6-L8): Callable ONCE by winningopId(== PegOutRecord.ReimbursementOperatorId, set fromFOREIGN_RELEASE) afterPegOutRecord.State == RELEASED; requires: (1)epoch(roundId)exists inVaultUtxoSet[assignedOutpoint].epochEntrieswithopId's bit set, (2) lane is NOT retired andidx(roundId) == lane.nextUnusedIdx, (3)RoundUsed[opId || roundId]absent, and (4)earliestKickoff := max(frontier.TimestampUnix, lane.nextEligibleKickoffTs) <= lane.anchorCutoffTs! DecrementspendingReservations--(if reserved on this lane), advanceslane.nextUnusedIdx++, setslane.nextEligibleKickoffTs = earliestKickoff + 5.5 days, marksRoundUsed = 1, and writesPegOutRecord.ReimbursementRoundId = roundId! (Recovery perR6-L8: if the claimed round expires/burns without operator fraud — e.g. slow blocks> 1.476xor fee spike> 500 sat/vB— Governance or deterministic proof ofStaleKilled/RoundRetiredwithassignedOutpointunspent invokesResetFailedReimbursementSlot(outboxId, proof)clearingReimbursementRoundId = 0so the honest operator may re-claim a fresh-epoch round!)SlashOperatorBond(domainId, opId, batchId, smtProof): Slashes100%ofOperatorBond_ZNN/QSR(>= 31,500 ZNN), setsactive = 0, and zeroes all remaining capacity across ALL lanes ofopId.- Bounded Guardian Drain: Guardian-initiated
DRAINING_ROLLOVER_STOPcarries mandatory7-daygovernance timer and NEVER blocksRequestPegOut.
4. Feeless Plasma, SHA3-256 PoW & Priority Lane Economics
- Standard
zBTCtransfers cost 0 satoshis and21,000Plasma (10 QSRrefundable fusion or31.5MSHA3-256 PoW hashes at floor price). - Challenge Priority Lane:
chain/account_pool.goreserves10of100Momentum slots for Settlement challenge/finalize calls ordered strictly byChallengeDepositZnndescending; paired with 48h (+12hsession) window defense-in-depth.
5. Peg-Free Atomic Swaps & Lightning Submarine-Swap Gateway
5.1 PTLC Taproot MuSig2 Adaptor Atomic Swap (BIP-327 Tweaked)
Protocol (Alice sells BTC, Bob sells zBTC; Bob holds secret $t$):
- Setup: Bob samples $t \in \mathbb{Z}_n^*$, sends compressed 33-byte point $T = \text{compress}(t \cdot G)$ to Alice.
- Bitcoin Funding (BIP-327 Tweaked Taproot): Compute $P_{\text{swap}} = \text{MuSig2_KeyAgg}(pk_A, pk_B)$, Tapscript refund leaf $L_{\text{ref}} = \text{<12> OP_CSV OP_DROP <pk_A> OP_CHECKSIG}$, tweak $t_{\text{tap}} = H_{\text{"TapTweak"}}(x(P_{\text{swap}}) \parallel \text{TapLeaf}(L_{\text{ref}}))$, and tweaked key $Q_{\text{swap}} = P_{\text{swap}} + t_{\text{tap}} \cdot G$ with BIP-327 accumulated tweak
t_accand key parityg_key. Alice funds0x51 0x20 || x(Q_swap). Let $h_{\text{conf}}$ be confirmation height and $T_{\text{btc_worst}}$ correspond to $h_{\text{conf}} + 12$. - Bob Locks
zBTCFIRST: BEFORE Alice releases ANY partial signature, Bob callsPtlcContract.Create(expirationTime = T_znn, pointType = 2, pointLock = compress(T), destination = Alice_Addr)(dev:vm/embedded/definition/ptlc.go:114-120) withT_znn >= T_btc_worst + 6 hours(21,600s). Wait until confirmed. - Alice Verifies Zenon Lock & Exchanges BIP-327 Tweaked Adaptor Signatures: Alice verifies the confirmed PTLC, exchanges MuSig2 nonces $(R_A, R_B)$, forms $R' = R_A + R_B + T$ with parity $g_R$, computes $e = H_{\text{BIP0340/challenge}}(x(R') \parallel x(Q_{\text{swap}}) \parallel m)$, exchanges $(\tilde{s}_A, \tilde{s}_B)$, and aggregates per BIP-327
PartialSigAgg: $$\tilde{s} = \tilde{s}A + \tilde{s}B + e \cdot g{\text{key}} \cdot t{\text{acc}} \pmod n$$ - Atomic Claim: Bob completes $s = \tilde{s} + g_R \cdot t \pmod n$ and broadcasts $(x(R'), s)$ before $h_{\text{conf}} + 12$. Alice extracts $t_{\text{ext}} = g_R \cdot (s - \tilde{s}) \bmod n$, verifies $\text{compress}(t_{\text{ext}} \cdot G) == \text{PointLock}$, and calls
PtlcContract.Unlock(ptlcId, t_ext)(dev:vm/embedded/implementation/ptlc.go:82-95).
5.2 HTLC Atomic Swaps & Lightning Network Submarine-Swap Gateway (hashType = 1 SHA256)
- ALL Bitcoin/Lightning HTLCs pass
hashType = 1(HashTypeSHA256,dev:vm/embedded/definition/htlc.go:92). - Inbound (LN →
zBTC): User pays Gateway's LN Hold Invoice FIRST; ONLY AFTER Hold Invoice reachesACCEPTEDwith CLTV>= now + 2 * Δ_safetydoes Gateway lockzBTCinHtlcContract(T_znn <= T_ln - Δ_safety). - Outbound (
zBTC→ LN): User lockszBTC(hashType = 1); Gateway pays BOLT-11 invoice (T_ln <= T_znn - Δ_safety), learns $r$, unlockszBTC. - Mandatory Conformance Vectors (G-18): Signet↔Zenon tests for claim-then-reclaim rejection, odd-$y(R')$ parity, BIP-327
PartialSigAggTaproot spend,hashType = 0rejection, Bob-locks-first ordering, and inbound LN Hold InvoiceACCEPTED-first enforcement.
Attack this spec & submit feedback
This is a Public RFC updated to v2 (v3.1.0-rfc) in response to Consolidated Hostile Review R8 (redlining against archived v1 / v3.0.0-rfc). Humans and AI review agents are invited to run python3 -I scripts/verify_spec_bounds.py, inspect the v1 → v2 changelog & redlines, file findings, or open pull requests.