user115309: I have already looked at link.
I am trying to generate P2SH address from output script but no luck. I am using transaction  40eee3ae1760e3a8532263678cdf64569e6ad06abc133af64f735e52562bccc8 for testing purpose which has one input and one output. The output goes to P2SH address that starts with 3. Output script looks like below
OP_HASH160
e9c3dd0c07aac76179ebc76a6c78d4d67c6c160a
OP_EQUAL

And destination address is 3P14159f73E4gFr7JterCCQh9QjiTjiZrG as per open source explorers. I tried
Base58Check(e9c3dd0c07aac76179ebc76a6c78d4d67c6c160a)
Followed instructions on https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses
But could not land to the address. Can anyone help me decoding the output script to fetch address.

user51948: The hash160 of the script is
e9c3dd0c07aac76179ebc76a6c78d4d67c6c160a

Prepend the version byte 05
05e9c3dd0c07aac76179ebc76a6c78d4d67c6c160a

Double sha-256 gives a checksum of
1. 5dad64852fbff1510074011803d9bf50b9650a517240d298a07ea5c525cdc5e7
2. 7f297f3156a14d114af23b33c339817a1241afcb52a154d19683c67c538b7278
first 4 bytes: 7f297f31

Encoding
05e9c3dd0c07aac76179ebc76a6c78d4d67c6c160a7f297f31

as Bitcoin's Base58 gives
3P14159f73E4gFr7JterCCQh9QjiTjiZrG

By the way, that's a pretty cool address. I assume it's a vanity address, 3 P(oint) 14159 = π.

115309: <p>I have already looked at <a href="https://bitcoin.stackexchange.com/questions/92957/how-to-parse-transaction-script-to-address-the-correct-way">link</a>.</p>
<p>I am trying to generate P2SH address from output script but no luck. I am using transaction  <code>40eee3ae1760e3a8532263678cdf64569e6ad06abc133af64f735e52562bccc8</code> for testing purpose which has one input and one output. The output goes to P2SH address that starts with 3. Output script looks like below</p>
<pre><code>OP_HASH160
e9c3dd0c07aac76179ebc76a6c78d4d67c6c160a
OP_EQUAL
</code></pre>
<p>And destination address is <code>3P14159f73E4gFr7JterCCQh9QjiTjiZrG</code> as per open source explorers. I tried</p>
<p>Base58Check(e9c3dd0c07aac76179ebc76a6c78d4d67c6c160a)</p>
<p>Followed instructions on <a href="https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses</a></p>
<p>But could not land to the address. Can anyone help me decoding the output script to fetch address.</p>
 51948: <p>The hash160 of the script is</p>
<pre><code>e9c3dd0c07aac76179ebc76a6c78d4d67c6c160a
</code></pre>
<p>Prepend the version byte <code>05</code></p>
<pre><code>05e9c3dd0c07aac76179ebc76a6c78d4d67c6c160a
</code></pre>
<p>Double sha-256 gives a checksum of</p>
<pre><code>1. 5dad64852fbff1510074011803d9bf50b9650a517240d298a07ea5c525cdc5e7
2. 7f297f3156a14d114af23b33c339817a1241afcb52a154d19683c67c538b7278
first 4 bytes: 7f297f31
</code></pre>
<p>Encoding</p>
<pre><code>05e9c3dd0c07aac76179ebc76a6c78d4d67c6c160a7f297f31
</code></pre>
<p>as Bitcoin's Base58 gives</p>
<pre><code>3P14159f73E4gFr7JterCCQh9QjiTjiZrG
</code></pre>
<p>By the way, that's a pretty cool address. I assume it's a vanity address, 3 P(oint) 14159 = π.</p>
