-
Notifications
You must be signed in to change notification settings - Fork 0
/
split.py
30 lines (18 loc) · 785 Bytes
/
split.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#from og_log import LOG,LEVEL
from bip39_splitter import Bip39Splitter
# INPUT PARAMETERS
PASSPHRASE = "seek service rib phone moon refuse chase cave rough annual total virus disagree knife truth math able dog online outer cram rent pull aerobic"
SPLIT_COUNT = 2
if __name__ == "__main__":
#LOG.start()
#LOG.level(LEVEL.warning)
print("Splitting : "+PASSPHRASE)
factory0 = Bip39Splitter(mnemonic=PASSPHRASE)
l = factory0.split(SPLIT_COUNT)
verify = []
for i in range(0,SPLIT_COUNT):
print(str(i)+": "+l[i])
verify.append(l[i])
factory1 = Bip39Splitter(mnemonic_list=verify)
if factory0.key != factory1.key: raise Exception("ERROR: Verify error : "+hex(factory0.key)+", "+hex(factory1.key))
print("Merge verify : OK")