[bitcoin-dev] Teleport Transactions: A CoinSwap implementation for Bitcoin

Chris Belcher belcher at riseup.net
Wed Feb 17 22:27:28 UTC 2021

Suppose Alice has bitcoins and wants to send them with maximal privacy,
so she creates a special kind of transaction. For anyone looking at the
blockchain her transaction appears completely normal with her coins
seemingly going from bitcoin address A to address B. But in reality her
coins end up in address Z which is entirely unconnected to either A or B.

Now imagine another user, Carol, who isn't too bothered by privacy and
sends her bitcoin using a regular wallet. But because Carol's
transaction looks exactly the same as Alice's, anybody analyzing the
blockchain must now deal with the possibility that Carol's transaction
actually sent her coins to a totally unconnected address. So Carol's
privacy is improved even though she didn't change her behaviour, and
perhaps had never even heard of this software.

In a world where advertisers, social media and other companies want to
collect all of Alice's and Carol's data, such privacy improvement would
be incredibly valuable. And also the doubt added to every transaction
would greatly boost the fungibility of bitcoin and so make it a better
form of money.

This undetectable privacy can be developed today by implementing
CoinSwap. The software could be standalone as a kind of bitcoin mixing
app, but it could also be a library that existing wallets can implement
allowing their users to send Bitcoin transactions with much greater privacy.

For the last few months I've been working on implementing this project.
Here it is:


The project can create multi-transaction CoinSwaps (intended to avoid
amount correlation), and multi-hop CoinSwaps (intended to stop one
single maker being able to unmix a taker's CoinSwap).

Just for fun I created a 5-hop CoinSwap on testnet. Here are the
transaction IDs of each funding transaction. Each hop has 3 individual

taker's outgoing txes:

maker[0] funding txes:

maker[1] funding txes:

maker[2] funding txes:

maker[3] funding txes (also taker's incoming txes):

The so-called taker organized the whole thing. They decided what the
CoinSwap amount should be (0.05 tBTC in this case), decided which makers
to route over depending on their fees, how many transactions and makers
there would be. The only thing the makers do is follow the protocol and
collect their CoinSwap fees, they are not meant to even know their
position in the route. Because the taker chose how much bitcoin to
coinswap and when, they paid a fee to each maker to provide an incentive
for the makers to keep the software running.

To a passive observer of the blockchain a single-hop CoinSwap is as
private as a multi-hop, so I suspect in practice most users will just
create 2-hop CoinSwaps.

The project is still a work in progress. All kinds of attacks are
possible right now, so the it shouldn't be used on mainnet with real
money yet. Also right now the CoinSwap addresses created by the project
appear as 2-of-2 multisignature addresses, but the plan is to use
ECDSA-2P which will make them look the same as regular single-signature
addresses which is needed before the thing massively improves privacy
and fungibility.

CoinSwap is the next generation of bitcoin on-chain privacy tech. It
improves on CoinJoin because it breaks the transaction graph, and even
improves the privacy of people who don't use it. CoinSwap also uses less
block space for the same privacy and therefore is cheaper in miner fees.

* Design document:
* Discussion: `##coinswap` IRC channel on the freenode network

More information about the bitcoin-dev mailing list