Skip to content

Instantly share code, notes, and snippets.

View justinpobrien's full-sized avatar

Justin O'Brien justinpobrien

  • United States
View GitHub Profile
Verifying that +justinpobrien is my openname (Bitcoin username). https://onename.com/justinpobrien
@justinpobrien
justinpobrien / trezor_recovery.py
Created August 16, 2017 02:00 — forked from mflaxman/trezor_recovery.py
Proof you can recover your Trezor funds without a Trezor (if it breaks and/or the company goes out of business)
from bitmerchant.wallet import Wallet
from mnemonic import Mnemonic
# put in whatever Trezor generates for you here (or backup from this empty/insecure one as a test)
mnemonic = 'clean health food open blood network differ female lion eagle rough upon update zone antique defense venture uncover mobile charge actress film vocal enough'
passphrase = '' # empty string or whatever you actually choose
path = "m/44'/0'/0'/0/0" # whatever shows up on the UI for that account (everything will start with m/44'/0' since it's bip44)
child = Wallet.from_master_secret(Mnemonic('english').to_seed(mnemonic, passphrase)).get_child_for_path(path)
child.to_address() # '18K9axbPpwqZgngB58nuwsYevL2z6ey4YG' (confirm this matches what Trezor is showing you)

Keybase proof

I hereby claim:

  • I am justinpobrien on github.
  • I am justinpobrien (https://keybase.io/justinpobrien) on keybase.
  • I have a public key ASAvX0Z3LbUVwHMFq-45imqdSJ-GKa6NZ7aHYO3Qw-GorQo

To claim this, I am signing this object: