1

For example :

take a look at this 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c scripthash.

I need help converting it to base58 address.

Thank you.

0

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

  • Hello Skaht, the expected result looks like a multisig address but that script belongs to non multisig address. Thanks. – sujoshi Sep 8 '18 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 Sep 8 '18 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 Sep 8 '18 at 18:03
  • The answer might be simpler: % echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx bitcoin160 | bx address-encode -v 5 3GRerFiaihoo7mwMBix6Xojtff46HBNtnB – skaht Sep 8 '18 at 18:09
  • Or: % echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ripemd160 | bx address-encode -v 5 This is most likely the answer without knowing more. 3JSbrUCtDBzWGVWjZ5rFDxBh2Kzhszor9U – skaht Sep 8 '18 at 18:17

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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