Simple Bitcoin cryptography implementation that generates BTC addresses from scratch and sends custom transactions with Bitcoin Core RPC.
🎥 Featured in my YouTube video: https://youtu.be/z2Ju7pcE6wo
-
Address Generation (
main.ipynb): Generate Bitcoin addresses from private keys using secp256k1- Legacy addresses (P2PKH)
- SegWit addresses (Bech32)
- Private key formats: decimal, hex, WIF
-
Transaction Sending (
send.ipynb): Send Bitcoin with custom messages via Bitcoin Core RPC- OP_RETURN data embedding
- PSBT workflow
-
Install dependencies:
pip install -r requirements.txt
-
For transaction sending, create
.envfile:RPC_USER=your_username RPC_PASSWORD=your_password RPC_HOST=127.0.0.1 RPC_PORT=8332
-
Run the notebooks:
main.ipynb- Generate Bitcoin addressessend.ipynb- Send transactions (requires Bitcoin Core)
ecdsa- Elliptic curve cryptographybase58- Address encodingbech32- SegWit address encodingbitcoinrpc- Bitcoin Core RPC client