Swift Bitcoin – Full node library

Oct 3, 2023 • Announcements

Swift Bitcoin Roadmap

The ultimate goal for Swift Bitcoin is to become the most comprehensive SDK for bitcoin in Swift with features like mempool management, block mining and connectivity via the bitcoin protocol.

The library is being written entirely in Swift. Its only dependency is the official libsecp256k1 for ECDSA and Schnorr cryptography.

The library aims to provide full support for bitcoin transactions, SCRIPT, segregated witness, taproot, tapscript and more.

Development Roadmap

We want the library to be fully tested from the beginning. When available we will use test vectors from the BIPs and reference implementations or port tests directly from Bitcoin Core.

This implies a slow and steady progress but the end result will be a secure and robust product on which developers can base their solutions.

Below is a rough roadmap of the order in which features could be integrated.

  • Full transaction model with script, lock-time, input sequence and witness.
  • Transaction serialization and deserialization.
  • SCRIPT interpreter loop.
  • Transaction signature hash, signature signature hash types and signature generation (ECDSA).
  • OP_CHECKSIG.
  • Transaction verifying for Pay-to-Public-Key (P2PK) and Pay-to-Public-Key-Hash (P2PKH).
  • OP_RIPEMD160, OP_SHA256, OP_HASH256, OP_HASH160 and other cryptographic operations.
  • Base58 and Base58Check address encoding/decoding.
  • OP_CHECKMULTISIG.
  • Transaction verifying P2SH.
  • Relative lock-time.
  • OP_CHECKSEQUENCEVERIFY.
  • OP_CHECKLOCKTIMEVERIFY.
  • NULLDUMMY.
  • Other script operations (arithmetic, stack, …).
  • Segwit transaction verifying P2WPKH, P2WSH, P2SH-P2WPKH, P2SH-P2WSH.
  • Bech32 address encoding/decoding.
  • Transaction Schnorr signature generation.
  • Pay-to-Taproot P2TR (key-hash spends only).
  • Transaction signing for all standard scripts.
  • Bech32m address encoding/decoding.
  • OP_CHECKSIGADD (witness V1 script).
  • Tapscript transactions.