Closed mrtnetwork closed 1 year ago
the first question was solved :D my UTXO is p2pk and we must use the public key in the transaction script (not hash) to sign a transaction and unlocking script only needs a signed hex Thanks
Address 2MxnaH4QGVz34aVHQDtYbqRVJapAuk6BTBW is for a P2PKH wrapped in P2SH -> P2SH(P2PKH) i.e. that is what .to_script_pub_key() returns!
Address 2MxnaH4QGVz34aVHQDtYbqRVJapAuk6BTBW is for a P2PK wrapped in P2SH -> P2SH(P2PK)
Note that both P2PKH and P2PK are standard output types and thus can (and in most cases should) be used directly (not wrapped in P2SH, which will complicate spending). I typically use P2PK for demonstrating P2SH only because it is a small and easy to understand script -- not because I needed to.
Hi Code
Why does the script below give me a different address? Shouldn't it be the same?
In the transaction, I wanted to send it to the
2MxnaH4QGVz34aVHQDtYbqRVJapAuk6BTBW
but in the last one it was sent to this2N7uZgvLwjTBteicco18NSx91g2XGiQAixZ
Thank you, sorry, I'm a newbie