owned this note
owned this note
Published
Linked with GitHub
---
tags: Roadmap
---
# Mapping of RFCs to M1 deliverables
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](https://ccs.getmonero.org/proposals/h4sh3d-atomic-swap-implementation.html).
## How to use this document
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](https://github.com/farcaster-project/RFCs/blob/master/README.md), 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.
## Changes since the proposal
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.
#### A. Specification of `swap-daemon`
Detailed description and specification of the `swap-daemon`, internal and external.
#### `DONE` A.1 User-facing [35% of M1] [2 weeks]
* Specify `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: 01. High Level Overview](https://github.com/farcaster-project/RFCs/blob/master/01-high-level-overview.md)-->
> [RFC: 02. User Stories](https://github.com/farcaster-project/RFCs/blob/master/02-user-stories.md) 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](https://github.com/farcaster-project/RFCs/blob/master/04-protocol-messages.md).
> [color=violet]
> - [ ] `ENHANCEMENT`: link user stories not only to inter-daemon messages, but also client<->daemon messages
* Specify the API that `swap-cli` and `swap-gui` consume from `swap-daemon`.
> `swap-cli` and `swap-gui` consume the same interface specified in > [RFC: 06. Datum & Instructions](https://github.com/farcaster-project/RFCs/blob/master/06-datum-and-instructions.md)
* Specify the networking stack between `swap-daemon` and: `swap-daemon` counterparty and `swap-client`s.
> [RFC: 03. Farcaster Architecture](https://github.com/farcaster-project/RFCs/blob/master/03-farcaster-architecture.md) 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](https://github.com/farcaster-project/RFCs/blob/master/04-protocol-messages.md). The networking messages between `swap-daemon` and `swap-client`s are specified down to the TLV level in [RFC: 06. Datum & Instructions](https://github.com/farcaster-project/RFCs/blob/master/06-datum-and-instructions.md)
#### `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:
* Specify the subset of `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 primitives `swap-lib` has to provide to `swap-daemon` are specified in [RFC: 07. Cryptographic Setup]
> The transactions involved in a swap are specified in [RFC: 08. Transactions](https://github.com/farcaster-project/RFCs/blob/master/08-transactions.md)
> Recovery from an interrupted swap is specified in [RFC: 09. Swap State](https://github.com/farcaster-project/RFCs/blob/master/09-swap-state.md)
* Specify API and network stack for `swap-daemon`'s required calls to `chain-syncer`s
> Both are included and described in the more encompassing specifation of `M1.C`
#### B. Specification of `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]
* Specify `swap-lib`'s public API to be consumed by `swap-daemon` only.
Preliminarily, covers `InitTx()`, `VrfyTx()`, `Vrfy()`, and `EncVrfy()` from the whitepaper.
> [RFC: 07. Cryptographic Setup: Adaptor Signatures](https://github.com/farcaster-project/RFCs/blob/master/07-cryptographic-setup.md#adaptor-signatures) specifies `Vrfy()`, `EncVrfy()` scripts for both Taproot and ECDSA. The script structures of transactions (for `InitTx()` and `VrfyTx()`) are specified in [RFC: 08. Transactions](https://github.com/farcaster-project/RFCs/blob/master/08-transactions.md).
* Specify `swap-lib`'s public API to be consumed by `swap-client`s only.
Preliminarily, covers `Sign()`, `EncSign()`, `DecSig()`, `RecKey()`, and `Rec()` from the whitepaper.
> [RFC: 07. Cryptographic Setup: Signatures](https://github.com/farcaster-project/RFCs/blob/master/07-cryptographic-setup.md#signatures) specifies the constraints on `Sign()`
> [RFC: 07. Cryptographic Setup: Adaptor Signatures](https://github.com/farcaster-project/RFCs/blob/master/07-cryptographic-setup.md#adaptor-signatures) specifies `EncSig()`, `DecSig()` and `Rec()` scripts, both for ECDSA and Taproot.
* Specify `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 the `daemon`.
> Relevant RFCs:
> [RFC: 07. Cryptographic Setup](https://github.com/farcaster-project/RFCs/blob/master/07-cryptographic-setup.md)
> [RFC: 08. Transactions](https://github.com/farcaster-project/RFCs/blob/master/08-transactions.md)
> [RFC: 09. Swap State](https://github.com/farcaster-project/RFCs/blob/master/09-swap-state.md)
#### `DONE` B.2 Internal specification of `swap-lib` [16.25% of M1] [1 week]
* Specify internal function calls of `swap-lib`.
> [RFC: 07. Cryptographic Setup](https://github.com/farcaster-project/RFCs/blob/master/07-cryptographic-setup.md) specifies the cryptographic functions called to satisfy the API exposed to `swap-daemon` and `swap-client`.
<!--- [RFC: 09. Swap State](https://github.com/farcaster-project/RFCs/blob/master/09-swap-state.md) --->
* Specify a concrete implementation to support a chain, including all cryptographic primitives that must be supported.
> Cryptographic primitives are described in [RFC: 07. Cryptographic Setup](https://github.com/farcaster-project/RFCs/blob/master/07-cryptographic-setup.md), while [RFC: 08. Transactions](https://github.com/farcaster-project/RFCs/blob/master/08-transactions.md) covers the transactions necessary for a swap
#### `DONE` C. Specification of `chain-syncer` [16.25% of M1] [1 week]
* Specify the functionality and interface `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](https://github.com/farcaster-project/RFCs/blob/master/05-tasks-and-events.md)
* Specify the networking stack between `swap-daemon` and `chain-syncer`s.
> [RFC: 03. Farcaster Architecture](https://github.com/farcaster-project/RFCs/blob/master/03-farcaster-architecture.md)
> The networking messages between `swap-daemon` and `chain-syncer`s are specified down to the TLV level in [RFC: 05. Tasks & Blockchain Events](https://github.com/farcaster-project/RFCs/blob/master/05-tasks-and-events.md)
# Proposed changes & concrete design choices
## Taproot
The specifications target Taproot and as such require integration of Taproot into Bitcoin. As reported in our [December update](https://www.reddit.com/r/Monero/comments/kjgi5g/farcaster_atomicswap_community_update_december/), 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](https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-March/018583.html) will find agreement.
## LNP-BP
The technological choice to build atop LNP-BP has impacted design of the library immensely.
Our [January update](https://www.reddit.com/r/Monero/comments/l9offg/farcaster_community_update_january/) 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](https://github.com/farcaster-project/farcaster-node) and started integration work.