Skip to content

Instantly share code, notes, and snippets.

View ismaelsadeeq's full-sized avatar
🍭
learning and building

Abubakar Sadiq Ismail ismaelsadeeq

🍭
learning and building
View GitHub Profile

Out-of-Order Validation & The Single Spend Check

This is largely a summary of a series of insights and ideas around parallel validation that were discussed at the 2140 Bitcoin Consensus Code Week. This involved participants who work on Bitcoin Core, Libbitcoin, Floresta, BTCD, and various others.

Maximizing Resources

It's well-known that in order to maximize your hardware resources, software generally should try to minimize ordering constraints. The more you can do in parallel, the better you can utilize your hardware without waiting on prior things to finish. This write-up maps out the areas where we can apply this to Bitcoin and what tradeoffs it entails. Most of this is not new and summarizes community knowledge, though one small novel component is how you can parallelize double spend validation with a single spend check.

First, let's describe the ordered components of validation.

@NeilMadden
NeilMadden / crypto.py
Last active September 10, 2025 16:46
A Lazy Developer’s Guide to Modern Cryptography
#!/usr/bin/env python3
# Copyright 2024 Neil Madden.
# License: https://creativecommons.org/licenses/by-sa/4.0/deed.en.
# Like this? I do training courses & consultancy:
# https://illuminated-security.com/
import hashlib
import math
import os

A description of known problems in Satoshi Nakamoto's paper, "Bitcoin: A Peer-to-Peer Electronic Cash System", as well as notes on terminology changes and how Bitcoin's implementation differs from that described in the paper.

Abstract

The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power.