Link to this headingBitcoin

https://karpathy.github.io/2021/06/21/blockchain/

Link to this headingGenerating an Address

Download Addresses:

Sort List:

cat blockchair_bitcoin_addresses_and_balance_LATEST.tsv | grep "^b" > bech32_bitcoin_addresses cat blockchair_bitcoin_addresses_and_balance_LATEST.tsv | grep "^1" > p2pkh_bitcoin_addresses cat blockchair_bitcoin_addresses_and_balance_LATEST.tsv | grep "^3" > p2sh_bitcoin_addresses

Check Address list against:

comm -12 Bitcoin_addresses_LATEST.txt <(cat mylist.txt | sort | uniq)
import hashlib from cryptopals_lib import * def key2address(public_key, version=b"\x00"): # Compress the Public Key bytes_public_key = publicKey.compressed() # Hash the Public Key with SHA-256 then hash that output with RIPEMD-160 hashed_public_key = hashlib.new('ripemd160', hashlib.new('sha256', bytes_public_key).digest()).digest() #Version Information. \x00 for mainnet and \x6f for testnet #version = b"\x00" #Take the first 4 bytes of the double sha256 hashed publickey and version checksum = hashlib.new('sha256', hashlib.new('sha256', version + hashed_public_key).digest()).digest()[:4] # BASE58(Version || Hashed Output || Checksum) return b58encode(version + hashed_public_key + checksum) #Generate Private Public Key pair privateKey, publicKey = generate_KeyPair(secp256k1_Generator_Point) print(key2address(publicKey)) #1Nn73LPMp8T1dJUixQYMZvEBcZpVNgHTCn

Link to this headingSending a Transaction

import hashlib from cryptopals_lib import * #Generate From Address from_privateKey, from_publicKey = generate_KeyPair(secp256k1_Generator_Point) from_address = key2address(from_publicKey) #Generate To Address _, to_publicKey = generate_KeyPair(secp256k1_Generator_Point)

Link to this headingSignatures

[Schnorr_Signature](/Crypto/Signatures/Schorr Signature.md)