Skip to content

Instantly share code, notes, and snippets.

@rishkwal
rishkwal / coinswap-whitepaper-draft.md
Created October 30, 2024 12:53
Coinswap Whitepaper Draft

Coinswap Whitepaper

Abstract

There have been various attempts to introduce an atomic swap protocol within the Bitcoin network. The Coinswap protocol is a trustless, decentralized way to swap coins between two parties without the need for a trusted third party. The protocol was initially proposed by Greg Maxwell in 2013 and later improved by Chris Belcher in 2020. The protocol consists of several steps, including the funding transaction, contract transaction, hash preimage propagation followed by private key handover. The protocol can be executed with two or more participants. This whitepaper provides an overview of the Coinswap protocol, its variants, and its potential impact.

Introduction

The protocol was initially proposed by Greg Maxwell in 2013 in the bitcointalk.org forum. The idea was to create a trustless, decentralized way to swap coins between two parties without the need for a trusted third party. Chris Belcher later proposed a more efficient version of the protocol in 2020 on the bitcoi

@rishkwal
rishkwal / sequential-coinswap.md
Created September 10, 2024 08:33
An analysis of performing a multiple party coinswap sequentially

Coinswap with multiple makers in a sequential manner.

Alice and Bob perform a simple two-party coinswap. After doing a successful coinswap with Bob, Alice swaps the UTXO received from Bob with Charlie.

 | Alice           | Bob             | Charlie         |
 |=================|=================|=================|
0. A unsign htlc ---->               |                 |
1.               <---- A htlc B/2    |                 |
2. ***** BROADCAST AND MINE ALICE FUNDING TXES ******  |
3. A fund+htlc+p ---->               |                 |
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGTE5PoBEADHlFltpZ34Xy3U2A4PunUANbG8JK6BrPmP2fYb/6H6nzXsPt4F
83dPVqD1kJO/cWPhQj5NgR3EWbKDPK4DLodQ0eSbuc/A3WoTAmteqXTAYeHahui0
mryjsrTOFRdDWNnNXQQR+v5Xsd7UhcI/932T2r/QemNEuAtBGefO3M0ANaa/fxMl
PchLD1kmPfsuaY8ygxHXDEcN+2vPuDbtRzvTd2hAqaOkH5+RjFiLJHly5g9mdxuG
anccFi9t7uTfK8i4N7A1unLBj5aHviMNwmmbD+l6RblXV4Dn30iq31g7v5xzL3W7
/TuxXE1MfDFFe4Jm9dQGYd68aDza/1e0bMuv7D0YejTa9qs6DZPeLp/0LlJnqhiz
b3mt9S+FQrCxulZoK4iVvJmTWvgBCtke1zWiZWvnnCCWCQcb5qDQKhlcAVsfShS9
kVw3ZOL1n4KmJIx4QHwW9XTAIFOGcgCxcj0Fx/UGTQQkBGtSRKCk7aXog+ccDh6K