mirror of
https://github.com/bitcoin/bips.git
synced 2026-03-09 15:53:54 +00:00
This allows to remove secp256k1.py and replace the secp256k1-specific
parts in the reference implementation. Replacement guide:
* ECKey -> Scalar
* ECKey.set(seckey_bytes) -> Scalar.from_bytes_checked(seckey_bytes)
* seckey.get_pubkey() -> seckey * G
* seckey.get_bytes() -> seckey.to_bytes()
* seckey.add(tweak_bytes) -> seckey + Scalar.from_bytes_checked(tweak_bytes)
* seckey.negate() -> seckey = -seckey
* seckey.sign_schnorr -> schnorr_sign(..., seckey.to_bytes(), ...)
* ECPubKey -> GE
* ECPubKey.set(pubkey_bytes) -> GE.from_bytes_{xonly,compressed}(pubkey_bytes)
* pubkey.get_y() % 2 == 0 -> pubkey.has_even_y()
* pubkey.get_bytes(False) -> pubkey.to_bytes_compressed()
* pubkey.get_bytes() -> pubkey.to_bytes_xonly()
* not pubkey.valid -> pubkey.infinity
* pubkey.verify_schnorr -> schnorr_verify(..., pubkey.to_bytes_xonly(), ...)
* TaggedHash -> tagged_hash
* hashlib.sha256(preimage).digest() -> hash_sha256(preimage)