bitcoin-dev
Design for a CoinSwap implementation for massively improving Bitcoin privacy and fungibility
Posted on: June 6, 2020 01:40 UTC
The CoinSwap protocol has been split into three phases: channel establishment, HTLC forwarding, and HTLC resolution/private key handover.
The channel establishment phase is done first and can be done in any order, including reverse. The Spilman channel creates a temporary unidirectional time-bound channel with the same timelock on the HTLC, which allows Alice and Bob to fund their transactions simultaneously without risk of race loss. The HTLC forwarding and resolution are "done offchain" in the channels. The Spilman channel does not necessarily have to have the same timelock as the HTLC it will eventually host, as the contract transaction has no nLockTime
and can be instantiated (with loss of privacy due to the nonstandard script) before the Spilman timeout. The protocol is trivially extendable with more than one Bob.