<p>Take your choice using <a href="https://github.com/libbitcoin/libbitcoin-explorer/wiki" rel="nofollow noreferrer"><strong>bitcoin explorer</strong></a> (bx):</p>

<p><code>echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ec-to-public | bx sha256 | bx ripemd160 | bx base58check-encode -v 5</code></p>

<p><strong>32BcK7C6FBCzzyB617gwTQuaLdbQufuAcc</strong></p>

<p><code>% echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ec-to-public | bx bitcoin160 | bx base58check-encode -v 5</code></p>

<p><strong>32BcK7C6FBCzzyB617gwTQuaLdbQufuAcc</strong></p>

<p><code>% echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ec-to-public | bx ec-to-address -v 5</code></p>

<p><strong>32BcK7C6FBCzzyB617gwTQuaLdbQufuAcc</strong></p>

CC BY-SA 4.0
2018-09-08T16:20:14.617Z
Hello Skaht, the expected result looks like a multisig address but that script belongs to non multisig address. Thanks.
sujoshi
CC BY-SA 4.0
2018-09-08T17:24:43.663Z
Bitcoin P2SH and BIP 49 P2WPKH-nested-in-P2SH addresses both start with the number 3. Take a look at https://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**](https://github.com/libbitcoin/libbitcoin/wiki/Altcoin-Version-Mappings#bip44-altcoin-version-mapping-table).
skaht
CC BY-SA 4.0
2018-09-08T18:03:33.317Z
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
CC BY-SA 4.0
2018-09-08T18:09:45.340Z
The answer might be simpler:
```% echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx bitcoin160 | bx address-encode -v 5```

**3GRerFiaihoo7mwMBix6Xojtff46HBNtnB**
skaht
CC BY-SA 4.0
2018-09-08T18:17:28.067Z
Or: ```% echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ripemd160 | bx address-encode -v 5``` This is most likely the answer without knowing more.
**3JSbrUCtDBzWGVWjZ5rFDxBh2Kzhszor9U**
skaht
CC BY-SA 4.0
2018-09-08T19:16:29.087Z
Hello Skaht, thank you very much for understanding the issue. Heres an example: **scripthash**: 47e414636b2d5675ce1ef1459775792d9bee689f0b97b0a43f92a69cc3db4845  **address** : 19pTZUvpBt5EXPJSVjp56YA6AzUazNFGdi , i'm still trying to get that from your steps. :D
sujoshi
CC BY-SA 4.0
2018-09-09T03:45:53.823Z
What is the script before it gets hashed?
skaht
CC BY-SA 4.0
2018-09-08T16:00:19.217Z
2018-09-08T17:43:07.387Z
2018-09-08T17:43:07.387Z
skaht
<p>For example : </p>

<p>take a look at this  <strong>37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c</strong> scripthash. </p>

<p>I need help converting it to base58 address.</p>

<p>Thank you.</p>

<address><base58>
How to convert script hash to base58 address?
sujoshi
# How to convert script hash to base58 address?

(Asked by: username_0 on 2018-09-08)

For example :

take a look at this **37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c** scripthash.

I need help converting it to base58 address.

Thank you.

**Tags:** address, base58


---

## 1 answers

### Answer by username_1 on 2018-09-08. Score: 1 | Accepted answer

Take your choice using [**bitcoin explorer**](https://github.com/libbitcoin/libbitcoin-explorer/wiki) (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**

> **Comments:**
> **username_0**: Hello Skaht, the expected result looks like a multisig address but that script belongs to non multisig address. Thanks.  
> **username_1**: Bitcoin P2SH and BIP 49 P2WPKH-nested-in-P2SH addresses both start with the number 3. Take a look at https://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**](https://github.com/libbitcoin/libbitcoin/wiki/Altcoin-Version-Mappings#bip44-altcoin-version-mapping-table).  
> **username_1**: 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.  
> **username_1**: The answer might be simpler: ```% echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx bitcoin160 | bx address-encode -v 5```  **3GRerFiaihoo7mwMBix6Xojtff46HBNtnB**  
> **username_1**: Or: ```% echo 37d1d453311ea5682cdb31468826178db15fa731722a5dbb09525ea901f1c41c | bx ripemd160 | bx address-encode -v 5``` This is most likely the answer without knowing more. **3JSbrUCtDBzWGVWjZ5rFDxBh2Kzhszor9U**  
> **username_0**: Hello Skaht, thank you very much for understanding the issue. Heres an example: **scripthash**: 47e414636b2d5675ce1ef1459775792d9bee689f0b97b0a43f92a69cc3db4845  **address** : 19pTZUvpBt5EXPJSVjp56YA6AzUazNFGdi , i'm still trying to get that from your steps. :D  
> **username_1**: What is the script before it gets hashed?  

---

