Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🕵️‍♂️ Bitcoin P2PK Vulnerability Scanner (.NET 8)

📌 About The Project

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.


🚀 Technical Stack & Features

  • C# / .NET 8: Leveraging asynchronous programming (async/await) and CancellationToken for 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.

⚙️ How It Works

  1. Connects to Esplora-based REST APIs using masked headers to bypass anti-bot protections.
  2. Paginates through block transactions to parse scriptpubkey outputs.
  3. Identifies p2pk scripts and queries the UTXO set to confirm if the 50 BTC reward is still unspent.
  4. Converts the 65-byte uncompressed public key into a readable 1Address... format.
  5. Logs the findings (Block, TxID, Amount, PubKey, Address) into a structured dataset.

🧠 Cryptographic Context

The extracted raw public keys (points on the $y^2 = x^3 + 7$ elliptic curve) serve as a foundation for researching cryptographic vulnerabilities, including ECDSA nonce reuse or future quantum computing threats (Shor's algorithm), where exposed public keys reduce the security complexity.

About

Bitcoin P2PK Vulnerability Scanner (.NET 8)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages