Skip to content

Instantly share code, notes, and snippets.

@ajax000-ai
ajax000-ai / bitcoin.py
Last active December 5, 2023 09:35 — forked from HelloZeroNet/bitcoin.py
Bitcoin signature signing and verficiation using coincurve
import hashlib
import struct
from coincurve import PrivateKey, PublicKey
from base58 import b58encode_check, b58decode_check
from hmac import compare_digest
RECID_MIN = 0
RECID_MAX = 3
RECID_UNCOMPR = 27
LEN_COMPACT_SIG = 65