Skip to content

Instantly share code, notes, and snippets.

@noirbizarre
Last active October 9, 2020 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noirbizarre/1d1e0e071887ae27957c02eea98c5293 to your computer and use it in GitHub Desktop.
Save noirbizarre/1d1e0e071887ae27957c02eea98c5293 to your computer and use it in GitHub Desktop.
import json
from pytezos import pytezos, crypto
CURVES = b'ed', b'sp', b'p2'
for curve in CURVES:
key = crypto.Key.generate(curve=curve)
filename = f'{key.public_key_hash()}.json'
with open(filename) as inf:
data = json.load(inf)
data['secret'] = key.secret_key()
data['hexkey'] = key.public_point.hex().upper()
data['public'] = key.public_key()
with open(filename, 'w+') as f:
f.write(json.dumps(data, indent=4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment