forked from bitbegin/eth-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bip32-test.red
37 lines (28 loc) · 2.04 KB
/
bip32-test.red
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
29
30
31
32
33
34
35
36
37
Red []
#include %bip32.red
;-- test from https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
probe priv: bip32key/decode "xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi"
probe pub: bip32key/decode "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8"
probe secp256/create-pubkey priv/6
bin-entropy: #{000102030405060708090a0b0c0d0e0f}
print [80000000h]
probe bip32key/encode bip32key/derive bin-entropy [80000000h] true
probe bip32key/encode bip32key/derive bin-entropy [80000000h] false
print [80000000h 1]
probe bip32key/encode bip32key/derive bin-entropy [80000000h 1] true
probe bip32key/encode bip32key/derive bin-entropy [80000000h 1] false
print [80000000h 1 80000002h]
probe bip32key/encode bip32key/derive bin-entropy [80000000h 1 80000002h] true
probe bip32key/encode bip32key/derive bin-entropy [80000000h 1 80000002h] false
print [80000000h 1 80000002h 2]
probe bip32key/encode bip32key/derive bin-entropy [80000000h 1 80000002h 2] true
probe bip32key/encode bip32key/derive bin-entropy [80000000h 1 80000002h 2] false
print [80000000h 1 80000002h 2 1000000000]
probe bip32key/encode bip32key/derive bin-entropy [80000000h 1 80000002h 2 1000000000] true
probe bip32key/encode bip32key/derive bin-entropy [80000000h 1 80000002h 2 1000000000] false
print ["ext pubkey: " 1000000000]
probe bip32key/encode bip32key/derive-extkey bip32key/decode "xpub6FHa3pjLCk84BayeJxFW2SP4XRrFd1JYnxeLeU8EqN3vDfZmbqBqaGJAyiLjTAwm6ZLRQUMv1ZACTj37sR62cfN7fe5JnJ7dh8zL4fiyLHV" [1000000000] false
print ["ext privkey: " 1000000000]
probe bip32key/encode bip32key/derive-extkey bip32key/decode "xprvA2JDeKCSNNZky6uBCviVfJSKyQ1mDYahRjijr5idH2WwLsEd4Hsb2Tyh8RfQMuPh7f7RtyzTtdrbdqqsunu5Mm3wDvUAKRHSC34sJ7in334" [1000000000] false
print ["ext privkey: " 1000000000]
probe bip32key/encode bip32key/derive-extkey bip32key/decode "xprvA2JDeKCSNNZky6uBCviVfJSKyQ1mDYahRjijr5idH2WwLsEd4Hsb2Tyh8RfQMuPh7f7RtyzTtdrbdqqsunu5Mm3wDvUAKRHSC34sJ7in334" [1000000000] true