Bitcoin Forum
May 28, 2024, 10:10:12 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Importing and exporting raw seed data  (Read 703 times)
Sauderite (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
December 30, 2014, 07:46:36 PM
 #1

Hello all,
I am using electrum from git as I wanted a standard BIP44 key for storing bitcoins. I am experimenting with saving/restoring my seed to ensure I will be able to do so in the future or on another client. For the most part, I have it working but am wondering how to turn a seed back into an electrum 13 word mnemonic...
What I have so far:
To backup a seed, back up the mnemonic of course then extract the seed:
from electrum import mnemonic
m = Mnemonic
print m.mnemonic_to_seed(sys.argv[1], '').encode('hex')
That outputs the 256 bit seed used to create the initial bip32 key. The initial bip32 key doesn't appear to be stored in the wallet. Only the mnemonic and m/44'/0'/0' is stored I believe. The key can be generated with:
sx hd-seed hexstring
from mnemonic_to_seed. Outputs the XPRV string.
So that allows me to restore the wallet into another client if need be.

Does anyone know how one gets that 256 bit key back into a usable electrum mnemonic?
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
December 31, 2014, 06:27:49 AM
 #2

The mnemonic is run through a hashing function so it is not possible to convert the seed back to the mnemonic:

https://github.com/spesmilo/electrum/blob/12e9e40fce489d0221b21261c8d7d771dc9db887/lib/mnemonic.py#L121

dabura667
Sr. Member
****
Offline Offline

Activity: 475
Merit: 252


View Profile
January 01, 2015, 08:49:58 AM
 #3

There is 0 compatibility for Electrum with BIP39. The 13 word phrase is run through a hashing algorithm to generate the main extended private key... however, BIP39 states that mnemonics MUST have words in multiples of 3.

13 is not a multiple of 3, so sx, and any other BIP39 implementation will not be able to support Electrum seeds.

My Tip Address:
1DXcHTJS2DJ3xDoxw22wCt11FeAsgfzdBU
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!