This project is a high-performance, resilient blockchain scanner built in C#. It interacts with the Bitcoin blockchain to identify, extract, and index unspent P2PK (Pay-to-Pubkey) transactions from the early Satoshi Era (2009-2010).
Unlike modern P2PKH or SegWit transactions, P2PK scripts expose the full ECDSA public key directly in the blockchain. This scanner identifies these specific outputs, verifies if the funds are still unspent, and extracts the raw public keys for cryptographic research and elliptic curve vulnerability analysis.
- C# / .NET 8: Leveraging asynchronous programming (
async/await) andCancellationTokenfor graceful shutdowns. - Resilience & Rate Limiting: Implemented custom retry policies and exponential backoff to handle HTTP 429 (Too Many Requests) and Cloudflare 403 blocks.
- Cryptography (
NBitcoin): Translates raw ECDSA public keys (secp256k1) into standard Legacy Bitcoin addresses (Base58Check) for balance verification. - State Management: Auto-saves scanning progress to a local JSON/text state file, allowing the scanner to pause and resume without data loss.
- Data Persistence (
ClosedXML): Automatically flushes discovered vulnerable keys and unspent 50 BTC rewards to an Excel/CSV dataset.
- Connects to Esplora-based REST APIs using masked headers to bypass anti-bot protections.
- Paginates through block transactions to parse
scriptpubkeyoutputs. - Identifies
p2pkscripts and queries the UTXO set to confirm if the 50 BTC reward is still unspent. - Converts the 65-byte uncompressed public key into a readable
1Address...format. - Logs the findings (Block, TxID, Amount, PubKey, Address) into a structured dataset.
The extracted raw public keys (points on the