MCPcopy Create free account
hub / github.com/ElementsProject/elements / generate_privkey

Function generate_privkey

test/functional/test_framework/key.py:326–328  ·  view source on GitHub ↗

Generate a valid random 32-byte private key.

()

Source from the content-addressed store, hash-verified

324 return True
325
326def generate_privkey():
327 """Generate a valid random 32-byte private key."""
328 return random.randrange(1, SECP256K1_ORDER).to_bytes(32, 'big')
329
330def rfc6979_nonce(key):
331 """Compute signing nonce using RFC6979."""

Callers 7

create_taproot_utxoMethod · 0.90
csfs_testMethod · 0.90
create_taproot_utxoMethod · 0.90
spenders_taproot_activeFunction · 0.90
generateMethod · 0.85
test_schnorrMethod · 0.85

Calls 1

randrangeMethod · 0.80

Tested by 1

test_schnorrMethod · 0.68