1

For example :

take a look at this 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c scripthash.

I need help converting it to base58 address.

Thank you.

1 Answer 1

1

Take your choice using bitcoin explorer (bx):

echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ec-to-public | bx sha256 | bx ripemd160 | bx base58check-encode -v 5

32BcK7C6FBCzzyB617gwTQuaLdbQufuAcc

% echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ec-to-public | bx bitcoin160 | bx base58check-encode -v 5

32BcK7C6FBCzzyB617gwTQuaLdbQufuAcc

% echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ec-to-public | bx ec-to-address -v 5

32BcK7C6FBCzzyB617gwTQuaLdbQufuAcc

7
  • Hello Skaht, the expected result looks like a multisig address but that script belongs to non multisig address. Thanks.
    – sujoshi
    Commented Sep 8, 2018 at 16:20
  • Bitcoin P2SH and BIP 49 P2WPKH-nested-in-P2SH addresses both start with the number 3. Take a look at github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L132 to see why the version is set to 5. Also look at column 5 of this Table.
    – skaht
    Commented Sep 8, 2018 at 17:24
  • To provide more context, it would not hurt to share the original script that was encoded and hashed to 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c. I'm not 100% certain I properly answered your question.
    – skaht
    Commented Sep 8, 2018 at 18:03
  • The answer might be simpler: % echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx bitcoin160 | bx address-encode -v 5 3GRerFiaihoo7mwMBix6Xojtff46HBNtnB
    – skaht
    Commented Sep 8, 2018 at 18:09
  • Or: % echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ripemd160 | bx address-encode -v 5 This is most likely the answer without knowing more. 3JSbrUCtDBzWGVWjZ5rFDxBh2Kzhszor9U
    – skaht
    Commented Sep 8, 2018 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.