Open moodmosaic opened 4 weeks ago
with a test script, it seems to work fine:
addr=mkcL5EbpxqYtf1VHtrmBKgJ5aTfMttduUG #https://github.com/jcnelson/naka3.sh/blob/db72d0a536f30d1c85e935a33fbb2cd046a6234f/config.sh#L30
function b58_decode() {
local base58_chars="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxy"
local b58text="$1"
if [[ "$b58text" =~ ^(1*)([$base58_chars]+)$ ]]; then
dc -e "${BASH_REMATCH[1]//1/0P} 0${base58_chars//?/ds&1+} 0${BASH_REMATCH[2]//?/ 58*l&+}P" | hex_encode
else
return 1
fi
}
function hex_encode() {
od -An -v -tx1 | tr -d ' \n'
}
function b58_address_decode() {
local addr="$1"
b58_decode "$addr" | sed -r 's/^([0-9a-f]{2})([0-9a-f]{40}).+$/\1 \2#/g' | tr '#' '\n'
}
b58_decode "$addr" | sed -r 's/^([0-9a-f]{2})([0-9a-f]{40}).+$/\1 \2#/g' | tr '#' '\n'
pox_address=$addr
address_parts="$(b58_address_decode "$pox_address")"
address_version="$(echo "$address_parts" | cut -d ' ' -f 1)"
echo "address_parts: $address_parts"
echo "address_version: $address_version"
if [ "$address_version" != "6f" ]; then
echo "Only support testnet p2pkh"
fi
$ bash t
6f 37dce38faf7956918d6bd3c026cc8a628246dedc
address_parts: 6f 37dce38faf7956918d6bd3c026cc8a628246dedc
address_version: 6f
can this be reproduced? I'm wondering if a variable is getting overwritten somewhere maybe
update: this seems to be a version difference between linux's GNU dc and what macos is using.
let's keep this open for now, it would be nice to find a solution that works for both, but we're unblocked by only running on linux
The
stack-tx
operation in thenaka3.sh
script consistently fails (inmake_stacking_tx
) with the following error:I think, the failure occurs because the provided PoX address has a version byte of
8d
(instead of6f
?)Binary Versions:
/cc @wileyj