Last active
August 29, 2015 14:05
-
-
Save XertroV/de7c9de6d6f94e855cc6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Trezor wipe-and-load script. Generates fresh keys (or inserts predetermined mnemonic) """ | |
from trezorlib.client import TrezorClient | |
from trezorlib.transport_hid import HidTransport | |
import mnemonic | |
m = mnemonic.Mnemonic('english') | |
priv = m.generate(256) | |
devices = HidTransport.enumerate() | |
transport = HidTransport(devices[0]) | |
client = TrezorClient(transport) | |
status = client.wipe_device() | |
print status | |
pin = "" | |
pin_protect = False | |
label = "My Sexy Trezor" | |
lang = "en" | |
# HINT: to restore from a seed, just copy paste the wordlist in here: | |
# priv = 'words go here in order' | |
status = client.load_device_by_mnemonic(priv, pin, pin_protect, label, lang) | |
print status | |
print 'BACKUP SEED:' | |
print priv | |
print repr(priv) | |
print 'Some addrs:' | |
for i in range(10): | |
print client.get_address('Bitcoin', [i]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment