Everything Around Crypto
Bitcoin
$10,301.43
-226.15
(-2.15%)
Ethereum
$323.90
-21.02
(-6.09%)
Ripple
$0.23
-0.01
(-2.84%)
Litecoin
$43.10
-1
(-2.27%)
EOS
$2.47
-0.08
(-3.28%)
Cardano
$0.08
-0
(-5.39%)
Stellar
$0.07
-0
(-4.26%)
NEO
$20.39
+1.12
(+5.81%)
NEM
$0.11
0
(+0.29%)
DigitalCash
$65.46
-2.88
(-4.21%)
Tether
$1.00
-0
(-0.1%)
Binance Coin
$23.10
-0.98
(-4.07%)
QTUM
$2.23
-0.03
(-1.23%)
Verge
$0.00
-0
(-2.56%)
Ontology
$0.59
-0.05
(-7.81%)
ZCash
$51.24
-2.56
(-4.76%)
Steem
$0.16
-0
(-2.01%)
EUR
$1.10
0
(-0.08%)
GBP
$1.23
-0.01
(+0.67%)
JPY
$0.01
-0
(+0.14%)
CHF
$1.03
-0
(+0.45%)
CAD
$0.72
0
(-0.17%)
AUD
$0.66
-0.01
(+0.94%)
ZAR
$0.06
-0
(+0.36%)
RUB
$0.01
-0
(+0.81%)

Reliable fee-less Bitcoin transactions in Custody with Child-Pays-for-Parent

5

At Coinbase Custody we recognize this obstacle and continuously innovate to give our customers an edge when they need it the most. One obvious solution is to calculate transaction fees immediately before broadcasting it to the Bitcoin network — knowing the current network conditions enables us to predict an optimal fee. Unfortunately, Cold Storage security requirements make it difficult to estimate the fee right before the broadcast.

The Cold Storage security model requires that complete transaction payload (including amounts and destinations) is fully known beforehand, guarding against any changes to the payload after the key restore procedure is initiated. On the flip side, since the transaction fee is encoded in the payload, it means that the fee must be calculated long before the transaction is broadcast. If during that time gap the network suddenly becomes congested, the calculated fee may become inadequate for the transaction to be confirmed in a timely manner.

One interesting property of Bitcoin’s UTXO model is that transactions can be chained together creating a “bundle” that miners evaluate as a whole with respect to the fees. For example, if one (child) transaction spends an output of another (parent) transaction, the child transaction can pay fees for both — miners have no choice but to include the parent transaction if they want to collect the excess fees from the child transaction. This approach is commonly known as Child-Pays-For-Parent (CPFP).

The Coinbase Consumer platform has been successfully using CPFP to accelerate withdrawals for quite some time and you can learn more about it in the blog post. However, Custody’s unique challenges forced us to rethink the approach and come up with a different design.

In Custody we use CPFP to shift the fee estimation to immediately before the broadcast. In addition, we use a special Gas Station service to cover the transaction fees. Here’s how it works step-by-step:

  1. When a withdrawal from a cold address is initiated we do an initial fee estimate and use the Gas Station service to send 10x estimated fees to that address.

Let’s work through an example to better understand the mechanics of the solution. Note that some minor details are omitted for simplicity. Let’s say we have a customer who has a balance of 15 BTC and they would like to withdraw 12 BTC from their Custody account into an external Bitcoin address. Here are the steps that will happen (note that ‘satoshi’ or ‘sat’ is the smallest unit in Bitcoin and equals to 0.00000001 BTC):

  1. Custody estimates the fee to complete this transaction to be 10,000 sat.

Note that the destination address receives the clean 12 BTC amount. From the user perspective neither fees nor child transaction exist s— they are abstracted away and work behind the scenes to enable reliable zero-fee Bitcoin withdrawals.

This is just one example of interesting technical problems that Coinbase Custody engineers have an opportunity to work on. If you’re interested in joining the Coinbase Custody team, check out open roles here.

Leave A Reply

Your email address will not be published.