From 2ec9bbdc6c6661b955a144e27386a8445229915c Mon Sep 17 00:00:00 2001 From: Armin Sabouri Date: Fri, 15 May 2026 15:42:05 -0400 Subject: [PATCH 1/2] WIP - dependency graph --- dependency.dot | 172 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 dependency.dot diff --git a/dependency.dot b/dependency.dot new file mode 100644 index 0000000..a16dbf6 --- /dev/null +++ b/dependency.dot @@ -0,0 +1,172 @@ +digraph dependency_graph { + rankdir=TB; + splines=polyline; + compound=true; + node [fontname=Helvetica, fontsize=12, style=filled, shape=box]; + edge [fontname=Helvetica, fontsize=10, color="#444444"]; + + // ── Node definitions ───────────────────────────────────────────── + + // Goals + Fungibility [label="Fungibility", fillcolor="#4A90D9", fontcolor=white]; + Privacy [label="Privacy", fillcolor="#4A90D9", fontcolor=white]; + + // Core + CoinJoin [label="CoinJoin", fillcolor="#E67E22", fontcolor=white, penwidth=2]; + + // CoinJoin properties + BFT [label="BFT", fillcolor="#27AE60", fontcolor=white]; + Decentralized [label="Fully Decentralized", fillcolor="#27AE60", fontcolor=white]; + NetSettle [label="Net Settlement", fillcolor="#27AE60", fontcolor=white]; + Batching [label="Arbitrary Batching", fillcolor="#27AE60", fontcolor=white]; + Market [label="Market Based", fillcolor="#27AE60", fontcolor=white]; + Incentive [label="Incentive Compatible", fillcolor="#27AE60", fontcolor=white]; + + // Protocol instantiations — honest (left) and semi-honest (right) + HonestProtocol [ + label="Honest Protocol\n(trusting peers)", + fillcolor="#FFF0D0", fontcolor="#6B3A00", color="#E6A817", penwidth=2 + ]; + SemiHonestProtocol [ + label="Semi-Honest Protocol\n(metadata privacy required)", + fillcolor="#D8F0EE", fontcolor="#0d4a4a", color="#1A7A7A", penwidth=2 + ]; + + // Shared protocol components + TxStateMachine [ + label="Tx Construction\nState Machine", + fillcolor="#EDE7F6", fontcolor="#2C0080", color="#7B52CC", penwidth=2 + ]; + + // Specs and interfaces + PSBTLattice [ + label="PSBT Lattice Spec", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + P2PChannel [ + label="P2P Comms\nChannel", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + MsgSetReplication [ + label="Message Set\nReplication", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + + // Payment flow interfaces (boxed together) + subgraph cluster_payment_flow { + label="Payment Flow"; + style=filled; fillcolor="#F0EEFF"; color="#7B52CC"; + fontname=Helvetica; fontsize=11; fontcolor="#2C0080"; + { rank=same; PaymentInit; PaymentConfirm; } + + PaymentInit [ + label="Payment Initiation\nMessage", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + PaymentConfirm [ + label="Payment Confirmation\nMessage", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + } + + // Coalition Formation — concrete instantiation of Market Based + CoalitionFormation [ + label="Coalition Formation", + fillcolor="#D5F0D5", fontcolor="#1a4a1a", color="#27AE60", penwidth=2 + ]; + + // Orderbook Mechanism — abstract interface beneath Coalition Formation + OrderbookMechanism [ + label="Orderbook Mechanism", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + + // Open Gossip — concrete implementation of Orderbook Mechanism + OpenGossip [ + label="Open Gossip", + fillcolor="#FDEBD0", color="#E6A817", fontcolor="#333333" + ]; + + // Cost Function — abstract dependency of Incentive Compatible + CostFunction [ + label="Cost Function", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + + // Leaf implementations — honest (left): Nostr, iroh | semi-honest (right): BIP77Dir + Nostr [label="Nostr", fillcolor="#FDEBD0", color="#E6A817", fontcolor="#333333"]; + Iroh [label="iroh", fillcolor="#FDEBD0", color="#E6A817", fontcolor="#333333"]; + BIP77Dir [label="BIP77 Directory\n(OHTTP)", fillcolor="#D0EEEE", color="#1A7A7A", fontcolor="#333333"]; + + // ── Layer constraints (second axis) ───────────────────────────── + { rank=same; Fungibility; Privacy; } + { rank=same; BFT; Decentralized; NetSettle; Batching; Market; Incentive; } + { rank=same; HonestProtocol; SemiHonestProtocol; } + { rank=same; CoalitionFormation; CostFunction; } + { rank=same; OrderbookMechanism; PSBTLattice; P2PChannel; MsgSetReplication; } + { rank=same; OpenGossip; Nostr; Iroh; BIP77Dir; } + + // ── Honest/semi-honest axis ordering (invisible edges) ─────────── + // Forces honest nodes left of semi-honest nodes within each layer + HonestProtocol -> SemiHonestProtocol [style=invis]; + Iroh -> BIP77Dir [style=invis]; + + // ── Real edges ─────────────────────────────────────────────────── + + Fungibility -> CoinJoin; + Privacy -> CoinJoin; + + CoinJoin -> BFT; + CoinJoin -> Decentralized; + CoinJoin -> NetSettle; + CoinJoin -> Batching; + CoinJoin -> Market; + CoinJoin -> Incentive; + + // Market Based → Coalition Formation (concrete instantiation) + Market -> CoalitionFormation; + CoalitionFormation -> OrderbookMechanism; + OrderbookMechanism -> OpenGossip; + + // Incentive Compatible co-depends with BFT, depends on Market and Cost Function + Incentive -> Market; + Incentive -> BFT; + Incentive -> CostFunction; + BFT -> Incentive; + + Batching -> HonestProtocol; + Batching -> SemiHonestProtocol; + Batching -> TxStateMachine; + + NetSettle -> HonestProtocol; + NetSettle -> SemiHonestProtocol; + NetSettle -> TxStateMachine; + + HonestProtocol -> TxStateMachine; + HonestProtocol -> P2PChannel; + + SemiHonestProtocol -> TxStateMachine; + SemiHonestProtocol -> MsgSetReplication [label="requires metadata privacy"]; + + TxStateMachine -> PSBTLattice [label="by definition"]; + TxStateMachine -> MsgSetReplication [label="practically", style=dashed]; + TxStateMachine -> P2PChannel; + + NetSettle -> PaymentInit [lhead=cluster_payment_flow]; + + PaymentInit -> P2PChannel; + PaymentConfirm -> P2PChannel; + + P2PChannel -> Nostr; + P2PChannel -> Iroh; + MsgSetReplication -> Nostr; + MsgSetReplication -> Iroh; + MsgSetReplication -> BIP77Dir [label="OHTTP metadata privacy"]; +} From 41ae75959653d562c6c7ee34f9c1d2cb0ecd2c7a Mon Sep 17 00:00:00 2001 From: Armin Sabouri Date: Mon, 6 Jul 2026 14:09:36 -0400 Subject: [PATCH 2/2] Update dependency diagram --- dependency.dot | 130 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 107 insertions(+), 23 deletions(-) diff --git a/dependency.dot b/dependency.dot index a16dbf6..8089096 100644 --- a/dependency.dot +++ b/dependency.dot @@ -15,9 +15,7 @@ digraph dependency_graph { CoinJoin [label="CoinJoin", fillcolor="#E67E22", fontcolor=white, penwidth=2]; // CoinJoin properties - BFT [label="BFT", fillcolor="#27AE60", fontcolor=white]; - Decentralized [label="Fully Decentralized", fillcolor="#27AE60", fontcolor=white]; - NetSettle [label="Net Settlement", fillcolor="#27AE60", fontcolor=white]; + NetSettle [label="Net Settlement", fillcolor="#27AE60", fontcolor=white]; Batching [label="Arbitrary Batching", fillcolor="#27AE60", fontcolor=white]; Market [label="Market Based", fillcolor="#27AE60", fontcolor=white]; Incentive [label="Incentive Compatible", fillcolor="#27AE60", fontcolor=white]; @@ -32,6 +30,12 @@ digraph dependency_graph { fillcolor="#D8F0EE", fontcolor="#0d4a4a", color="#1A7A7A", penwidth=2 ]; + // Privacy Preservation — privacy mechanism for CoinJoin + PrivacyPreservation [ + label="Privacy Preservation", + fillcolor="#27AE60", fontcolor=white, penwidth=3 + ]; + // Shared protocol components TxStateMachine [ label="Tx Construction\nState Machine", @@ -80,6 +84,23 @@ digraph dependency_graph { fillcolor="#D5F0D5", fontcolor="#1a4a1a", color="#27AE60", penwidth=2 ]; + // BFT — Byzantine Fault Tolerance + BFT [label="BFT", fillcolor="#D5F0D5", fontcolor="#1a4a1a", color="#27AE60", penwidth=2]; + + // Session Parameters — parameters negotiated in coalition formation + SessionParameters [ + label="Session Parameters", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + + // Aggregator Role — role definition in coalition formation + AggregatorRole [ + label="Aggregator Role", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + // Orderbook Mechanism — abstract interface beneath Coalition Formation OrderbookMechanism [ label="Orderbook Mechanism", @@ -87,15 +108,64 @@ digraph dependency_graph { penwidth=2, style="filled,dashed", shape=component ]; + // BIP322 Ownership Proof — cryptographic proof mechanism for Orderbook + BIP322OwnershipProof [ + label="BIP322 Ownership\nProof", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + + // Final Proposal — outcome of session parameters and aggregator role + FinalProposal [ + label="Final Proposal", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + + // Cost Function — cost model for privacy preservation + CostFunction [ + label="Cost Function", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + + // Objective Fees — objective function component of cost model + ObjectiveFees [ + label="Objective Fees\n(e.g. fees)", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + + // Privacy Metrics — metrics for evaluating privacy preservation + PrivacyMetrics [ + label="Privacy Metrics", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + // Open Gossip — concrete implementation of Orderbook Mechanism OpenGossip [ label="Open Gossip", fillcolor="#FDEBD0", color="#E6A817", fontcolor="#333333" ]; - // Cost Function — abstract dependency of Incentive Compatible - CostFunction [ - label="Cost Function", + // Listen Advertisements — listening mechanism for Open Gossip + ListenAdvertisements [ + label="Listen Advertisements", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + + // Agreement — BFT agreement mechanism + Agreement [ + label="Agreement", + fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", + penwidth=2, style="filled,dashed", shape=component + ]; + + // Validity Proofs — cryptographic proofs for BFT + ValidityProofs [ + label="Validity Proofs", fillcolor="#F5F0FF", fontcolor="#2C0080", color="#7B52CC", penwidth=2, style="filled,dashed", shape=component ]; @@ -107,11 +177,11 @@ digraph dependency_graph { // ── Layer constraints (second axis) ───────────────────────────── { rank=same; Fungibility; Privacy; } - { rank=same; BFT; Decentralized; NetSettle; Batching; Market; Incentive; } - { rank=same; HonestProtocol; SemiHonestProtocol; } - { rank=same; CoalitionFormation; CostFunction; } - { rank=same; OrderbookMechanism; PSBTLattice; P2PChannel; MsgSetReplication; } - { rank=same; OpenGossip; Nostr; Iroh; BIP77Dir; } + { rank=same; NetSettle; Batching; Market; Incentive; PrivacyPreservation; } + { rank=same; HonestProtocol; } + { rank=same; CoalitionFormation; BFT; } + { rank=same; SessionParameters; AggregatorRole; OrderbookMechanism; PSBTLattice; P2PChannel; MsgSetReplication; Agreement; ValidityProofs; SemiHonestProtocol; CostFunction; } + { rank=same; FinalProposal; BIP322OwnershipProof; OpenGossip; Nostr; Iroh; BIP77Dir; ObjectiveFees; PrivacyMetrics; } // ── Honest/semi-honest axis ordering (invisible edges) ─────────── // Forces honest nodes left of semi-honest nodes within each layer @@ -123,31 +193,45 @@ digraph dependency_graph { Fungibility -> CoinJoin; Privacy -> CoinJoin; - CoinJoin -> BFT; - CoinJoin -> Decentralized; CoinJoin -> NetSettle; CoinJoin -> Batching; CoinJoin -> Market; CoinJoin -> Incentive; + CoinJoin -> PrivacyPreservation; - // Market Based → Coalition Formation (concrete instantiation) - Market -> CoalitionFormation; - CoalitionFormation -> OrderbookMechanism; - OrderbookMechanism -> OpenGossip; + // Privacy Preservation dependencies + PrivacyPreservation -> SemiHonestProtocol; + PrivacyPreservation -> CostFunction; + + // Cost Function dependencies + CostFunction -> ObjectiveFees; + CostFunction -> PrivacyMetrics; - // Incentive Compatible co-depends with BFT, depends on Market and Cost Function - Incentive -> Market; + // Market Based and Incentive Compatible → BFT and Coalition Formation + Market -> BFT; + Market -> CoalitionFormation; Incentive -> BFT; - Incentive -> CostFunction; - BFT -> Incentive; + Incentive -> CoalitionFormation; + + // BFT dependencies + BFT -> Agreement; + BFT -> ValidityProofs; + + // Coalition Formation dependencies + CoalitionFormation -> SessionParameters; + CoalitionFormation -> AggregatorRole; + CoalitionFormation -> OrderbookMechanism; + SessionParameters -> FinalProposal; + AggregatorRole -> FinalProposal; + OrderbookMechanism -> BIP322OwnershipProof; + OrderbookMechanism -> OpenGossip; + OpenGossip -> ListenAdvertisements; Batching -> HonestProtocol; Batching -> SemiHonestProtocol; - Batching -> TxStateMachine; NetSettle -> HonestProtocol; NetSettle -> SemiHonestProtocol; - NetSettle -> TxStateMachine; HonestProtocol -> TxStateMachine; HonestProtocol -> P2PChannel;