Spec draft


A bond is a transaction that sacrifices bitcoins by paying to a P2SH address that can be redeemed by anybody after some time. This is achieved by reveling the redeem script in a standaard OP_RETURN output in the same transaction.

See an example transaction in BlockCypher's block explorer or read more in this blogpost.


  • A transaction is said to create a bond when it sacrifices to miners coins that can be redeemed in the future following this specification.
  • This is done by paying to the script:
    <magic string> <target block height> OP_CHECKLOCKTIMEVERIFY OP_DROP
  • Since this is not a standard script, the payment is made using a P2SH output. To ensure that anybody can still spend it, the script (preimage of the P2SH output) is revealed in an OP_RETURN output present in the same transaction. Target block height must be 2015 blocks from the current tip (or more, until OP_CSV is deployed).
  • The magic string is '', ascii encoded, which helps programs to pattern match fidelity link transactions, and advertises the protocol.


Sample code

var bitcore = require('bitcore-lib')
var utxo = { /* json result from******/utxo */ }
var tx = new bitcore.Transaction()
var redeemScript = new bitcore.Script()
  .add(new Buffer(''))
  .add(bitcore.crypto.BN.fromNumber(400000 /* target block height, at least 2015 blocks in the future */).toScriptNumBuffer())
  .add(bitcore.Opcode.OP_DROP) bitcore.Address(redeemScript), 100 /* amount to pay to bond */)
tx.sign(/* private key */)

About is open source. Made by Esteban Ordano.

Based on Peter Todd's Fidelity Bonds writeout.