ryanwold.net

A civic-minded citizen seeking the singularity

Back to Entries

Bitblocks

Series: Bitcoin
draft
Date: 2023-11-02
Tags: bitcoin open source

Bitblocks is an open-source web application that is an interface to the bitcoinsv blockchain.

Features:

  • Query by transaction
  • Query by address
  • Query the UTXO set
  • What the CLI offers

Design notes

We started running a node in order to learn. So, we're building up from the basics and would like to share along the way.

About every 10 minutes, a block is generated by the bitcoin mining network; a group of cooperating and competing miners are seeking a random number that satisfies a relatively high amount of hash power.

A block has one or more transactions. Ideally, millions, billions in transactions, or more.

Each transaction has one or more Inputs based on some other unspent transaction on chain. And, each transaction has one or more Outputs. These outputs may be spent or not. And any remainder, any difference between the number of satoshis in the inputs vs the total number of satoshis in the outputs is a fee collected by the miner who mines the transaction into a block.


  • given a transaction
  • parse out its inputs and outputs which are both arrays
  • within each input parse its Script as it will be prepended to the target scriptPubKey - to unlock a transaction
  • within each output, parse its Script as scriptPubKey

For each script

  • identify addresses
  • note how many times op returns are used
  • are there common patterns
  • bitcom addresses
  • other types of transaction filters (like blocks that slot in)

Technical Notes

  • Block 724940 failed to sync because the PostgreSQL column for size was an integer. Updating it to bigint via an Elixir migration fixed the issue. The block size 2513932048 revealed the issue.

By Ryan Wold · © 2023–2026 Ryan Wold

Licensed CC BY-NC 4.0. AI training requires a license — machine-readable terms.

Enjoyed this? — any BSV wallet, HandCash, or plain old dollars.

Leave a tip

Tips go directly to a Bitcoin SV address I control — peer to peer, no platform in between. A few thousand satoshis is a fraction of a cent; it's the gesture that counts.

From any BSV wallet

Scan the QR code with your wallet's camera, or copy the address.

177DwUfSTW8RkFBJzYYcgr1YB8ngbhTYAc

With HandCash or any paymail wallet

Paymail is an email-style address for Bitcoin wallets. Send any amount to afomi@handcash.io

First time using Bitcoin? Yours Wallet is an open-source browser extension wallet, and HandCash is an easy mobile wallet — either takes a minute to set up.

Prefer regular money? Support via OpenCollective.