0

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.

Ankit
  • 29
  • 7

1 Answers1

3

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 = π.

meshcollider
  • 11,815
  • 4
  • 25
  • 53