This document's aim is to clearly map the Farcaster RFCs to the deliverables we promised in the first milestone of our funded CCS proposal for BTC/XMR atomic swaps.
Whether formally assessing our delivered milestone or just ratifying it to sleep well at night, in the peace of knowing the project is on track, we recommend following the RFCs linearly, as described in the RFC readme, to get a complete overview, before reverting to this document to cross-check against the deliveries. The milestone is copied over literally, and the mapping to RFCs is described in the comments.
A core goal of the spec-writing process is to ensure that the deliverables are compatible and functional in the sum of their parts. This process in Milestone 1 thus aims to identify limitations of the architecture presented in this proposal, which can impact the structure of Milestones 2 and 3. In case changes are consequently required, we will propose them to the community at the completion of Milestone 1, and we will ensure that the same final functionality as set out in this proposal will be delivered.
swap-daemon
Detailed description and specification of the swap-daemon
, internal and external.
DONE
A.1 User-facing [35% of M1] [2 weeks]swap-daemon
's outer API layer of user interaction (swap-client
s & counterparty swap-daemon
) first to guide design of inner dependencies (swap-lib
& chain-syncer
) to match desired UX. This includes protocol messages exchanged between swap participants, that is: interactions with the counterparty swap-daemon
.RFC: 02. User Stories contains a mockup of user interaction in a swap both via a GUI and a CLI, and also both from maker and taker perspectives. The individual steps of the user interaction throughout a swap are linked back to the relevant protocol messages of the API specified in RFC: 04. Protocol Messages.
ENHANCEMENT
: link user stories not only to inter-daemon messages, but also client<->daemon messages
swap-cli
and swap-gui
consume from swap-daemon
.
swap-cli
andswap-gui
consume the same interface specified in > RFC: 06. Datum & Instructions
swap-daemon
and: swap-daemon
counterparty and swap-client
s.RFC: 03. Farcaster Architecture provides a detailed overview of component interactions. The networking messages between counterparty daemons are specified down to the TLV level in RFC: 04. Protocol Messages. The networking messages between
swap-daemon
andswap-client
s are specified down to the TLV level in RFC: 06. Datum & Instructions
DONE
A.2 Service internals [16.25% of M1] [1 week]Specify links between swap-daemon
and the other deliverables it requires to facilitate a swap, but that are not user-facing, i.e. swap-lib
and chain-syncer
s:
swap-lib
's API strictly required for swap-daemon
's operation swap-lib
has to provide swap-daemon
with cryptographic primitives, transaction construction and parsing, and a recovery mechanism for an interrupted swap.Covered by the more encompassing requirements of
M1.B.1
The cryptographic primitivesswap-lib
has to provide toswap-daemon
are specified in [RFC: 07. Cryptographic Setup]
The transactions involved in a swap are specified in RFC: 08. Transactions
Recovery from an interrupted swap is specified in RFC: 09. Swap State
swap-daemon
's required calls to chain-syncer
sBoth are included and described in the more encompassing specifation of
M1.C
swap-lib
(core protocol)Detailed description and specification of all the libraries that, in conjunction, form swap-lib
, including stateless transaction construction libraries, crypto-libraries and their wrappers, and state-machine libraries for executing the protocol.
DONE
B.1 External specification of swap-lib
[16.25% of M1] [1 week]swap-lib
's public API to be consumed by swap-daemon
only.InitTx()
, VrfyTx()
, Vrfy()
, and EncVrfy()
from the whitepaper.RFC: 07. Cryptographic Setup: Adaptor Signatures specifies
Vrfy()
,EncVrfy()
scripts for both Taproot and ECDSA. The script structures of transactions (forInitTx()
andVrfyTx()
) are specified in RFC: 08. Transactions.
swap-lib
's public API to be consumed by swap-client
s only.Sign()
, EncSign()
, DecSig()
, RecKey()
, and Rec()
from the whitepaper.RFC: 07. Cryptographic Setup: Signatures specifies the constraints on
Sign()
RFC: 07. Cryptographic Setup: Adaptor Signatures specifiesEncSig()
,DecSig()
andRec()
scripts, both for ECDSA and Taproot.
swap-lib
's public API to be consumed by both swap-daemon
and swap-client
s.
swap-client
s also verify transaction validity before signing, so use the same verification functions exposed to thedaemon
.
Relevant RFCs:
RFC: 07. Cryptographic Setup
RFC: 08. Transactions
RFC: 09. Swap State
DONE
B.2 Internal specification of swap-lib
[16.25% of M1] [1 week]swap-lib
.RFC: 07. Cryptographic Setup specifies the cryptographic functions called to satisfy the API exposed to
swap-daemon
andswap-client
.
Cryptographic primitives are described in RFC: 07. Cryptographic Setup, while RFC: 08. Transactions covers the transactions necessary for a swap
DONE
C. Specification of chain-syncer
[16.25% of M1] [1 week]chain-syncer
has to expose in order to permit the swap-daemon
to carry out swaps. Describe what jobs are, and what jobs must be supported.Jobs have been renamed to tasks, and are described in RFC: 05. Tasks & Blockchain Events
swap-daemon
and chain-syncer
s.RFC: 03. Farcaster Architecture
The networking messages betweenswap-daemon
andchain-syncer
s are specified down to the TLV level in RFC: 05. Tasks & Blockchain Events
The specifications target Taproot and as such require integration of Taproot into Bitcoin. As reported in our December update, the plan is to add ECDSA support only if Taproot is not integrated by the time Farcaster would otherwise be ready to be used with mainnet Bitcoin. Hopefully, Russel O'Connor's speedy trial will find agreement.
The technological choice to build atop LNP-BP has impacted design of the library immensely.
Our January update delves into the motivation for this integration, and we address some of the concerns with it in the comment section.
We have forked the lnp-node here and started integration work.