And How Dev Tooling Can Benefit The End User

Where Your Wallet Fetches Transactions

Quick shout-out to @LagginTimes !

Who Am I?

  • Orange-pilled during COVID
  • Open Source Contributor to BDK
  • Currently funded by BDKF

@evanlinjin (GitHub, Twitter)

What is BDK

  • Bitcoin Wallet Library (On-Chain Transaction)
  • Free & Open Source
  • Modular & Flexible
  • Cross-platform

https://bitcoindevkit.org

Who Uses BDK?

Agenda

  • The Need For Light Clients
  • What is SPV (Simplified Payment Verification)
  • Electrum
  • Connection Bloom Filtering (BIP-37)
  • Client Side Block Filtering (BIP-157)
  • How BDK Can Help

The Need For Light Clients

Bitcoin-Qt

MyBitcoin.com Fiasco

2009 - 2011 Era

Mt. Gox Hack

What is SPV?

  • Mentioned in whitepaper
  • Simplified Payment Verification
  • Prove relevant transaction is committed to blockchain
  • Trusting the proof-of-work
  • Earliest SPV wallets are still high-bandwidth

https://bitcoin.org/bitcoin.pdf

Electrum

  • Brain-child of Thomas Voegtlin
  • Easy-to-use wallet with stronger security guarantees
  • Other innovations

Electrum - Thomas Voegtlin 7th September 2016

https://youtu.be/hjYCXOyDy7Y

Electrum Protocol

  • How Electrum client and server communicate
  • Electrum Client
    • Non-custodian
    • Connects to multiple Electrum servers
    • Verifies data from servers with SPV
  • Electrum Server
    • Serves methods
    • Multiple implementations: ElectrumX, Electrs, Electrum Personal Server, etc.
  • Many wallets use the Electrum protocol

https://electrum.readthedocs.io

Electrum Pros

  • Fast syncing, low-bandwidth
  • Does SPV checks

Electrum Cons

  • Server can omit data
  • Client gives addresses to server (privacy)

https://electrum.readthedocs.io

Bloom Filters (BIP-37)

  • An attempt at doing SPV privately
  • Client gives "bloom filter" to server
  • Configurable false-positive rate
  • Bitcoin P2P network

https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki

Problems with BIP-37

  • Hard to get privacy right
  • Servers can still omit data
  • Heavy on servers (DoS attack vector)

https://eprint.iacr.org/2014/763.pdf

Client Side Block Filtering (BIP-157)

  • Server creates filters
  • One filter per block
  • Client downloads block if filter matches interested data
  • Filter headers - verify authenticity

https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki

CBF Pros

  • Better privacy guarantees
  • Servers cannot omit data*
  • Filters generated once

CBF Cons

  • More bandwidth
  • More client-side processing

*assuming client is connected to at least one honest server

Bitcoin Wallets Today

  • Most wallets get transactions via Electrum servers
  • Most wallets do not do SPV
  • Most users do not run their own nodes
  • We need better defaults
  • We need better tooling for developers

How Does BDK Help?

Modular chain-data source

  • bdk_electrum
  • bdk_esplora
  • bdk_bitcoind_rpc
  • bdk_electrum (with SPV) ?
  • bdk_cbf ?
  • bdk_floresta ?
  • bdk_neutrum ?

https://github.com/bitcoindevkit/bdk

When BDK v1.0?

Stable API

When BDK v1.0?

Join the conversation

2024 Seoul

By Evan Lin

2024 Seoul

Where your wallet fetches transactions and how dev tooling can benefit the end-user

  • 3