Part of the ION fast-sync overlay epic #111. Option C — the native-P2P transport, complementing the HTTP gateway (#115).
btcd's wire.makeEmptyMessage is a closed switch, so custom commands can't ride the existing Bitcoin connection (verified on #115). The chosen path: vendor a small btcd fork (13x-tech/btcd) adding ONLY the ION messages we need, via a go.mod replace (same pattern the repo already uses for go-jose). Upstream them later if demand warrants.
Messages (handshake-gated by ServiceION #114)
getanchors{fromHeight,toHeight} → anchors{[]Bundle} — a bounded height range of verifiable bundles.
getcas{[]CID} → cas{[]blob} — content-addressed blobs, self-verifying.
Each implements wire.Message (BtcEncode/BtcDecode/Command/MaxPayloadLength) with strict size bounds, and is registered in the forked makeEmptyMessage. The p2p client's listeners handle them, calling the SAME fastsync.Service as the HTTP gateway (#115) — only the transport differs; the trust model (verify against own PoW chain) is identical.
Notes
Part of the ION fast-sync overlay epic #111. Option C — the native-P2P transport, complementing the HTTP gateway (#115).
btcd's
wire.makeEmptyMessageis a closed switch, so custom commands can't ride the existing Bitcoin connection (verified on #115). The chosen path: vendor a small btcd fork (13x-tech/btcd) adding ONLY the ION messages we need, via a go.modreplace(same pattern the repo already uses for go-jose). Upstream them later if demand warrants.Messages (handshake-gated by ServiceION #114)
getanchors{fromHeight,toHeight}→anchors{[]Bundle}— a bounded height range of verifiable bundles.getcas{[]CID}→cas{[]blob}— content-addressed blobs, self-verifying.Each implements
wire.Message(BtcEncode/BtcDecode/Command/MaxPayloadLength) with strict size bounds, and is registered in the forkedmakeEmptyMessage. The p2p client's listeners handle them, calling the SAMEfastsync.Serviceas the HTTP gateway (#115) — only the transport differs; the trust model (verify against own PoW chain) is identical.Notes
ServiceION(thespeaksIONgate from fast-sync 3/7: ION overlay discovery & capability handshake #114), so vanilla peers are never sent unknown commands.13x-tech/btcdfork is an outward action; coordinate before pushing it.