-
Notifications
You must be signed in to change notification settings - Fork 1
/
test-bitcoin-tool.sh
executable file
·22 lines (20 loc) · 1.26 KB
/
test-bitcoin-tool.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
TEST="tests/$1.test"
if [ -f "$TEST" ]; then
cat "$TEST"
else
WIFXY=$(bitcoin-tool --input-type private-key --input-format hex --output-type private-key-wif --output-format base58check --network bitcoin --public-key-compression uncompressed --input $1)
WIFX=$(bitcoin-tool --input-type private-key --input-format hex --output-type private-key-wif --output-format base58check --network bitcoin --public-key-compression compressed --input $1)
ADDRXY=$(bitcoin-tool --input-type private-key --input-format hex --output-type address --output-format base58check --network bitcoin --public-key-compression uncompressed --input $1)
ADDRX=$(bitcoin-tool --input-type private-key --input-format hex --output-type address --output-format base58check --network bitcoin --public-key-compression compressed --input $1)
ADDRBECH32=$(bitcoin-tool --input-type private-key --input-format hex --output-type address --output-format bech32 --network bitcoin --public-key-compression compressed --input $1)
(cat << EOF
Privkey (HEX) : $1
Privkey (WIF XY) : $WIFXY
Privkey (WIF X) : $WIFX
Address (XY) : $ADDRXY
Address (X) : $ADDRX
Address (Bech32) : $ADDRBECH32
EOF
) | tee "$TEST"
fi