mattoshi on Nostr: Yep! So I'll just focus on p2wpkh. The locking script for those UTXOs looks like ...
Yep! So I'll just focus on p2wpkh. The locking script for those UTXOs looks like this: 00 14 <20 byte pubKeyHash>. Old nodes interpret it as, push an empty array to the stack then push 20 bytes (convert 16 from hex to decimal) to the stack. They think that anybody can spend this UTXO because it doesn't have any signature checks! Even a signature field with just 00 would be valid according to their rules. If old nodes could think like a human, I like to picture them looking at the current blockchain and being so confused as to why all of these transactions are happening without signatures. In reality, most of the nodes are upgraded to segwit. These segwit nodes require an additional field on the transaction called a witness (old nodes never even see this). When a segwit node verifies the same transaction, it will verify that the witness field contains a public key that hashes to correct value and has valid signature.
Published at
2023-04-25 13:14:19Event JSON
{
"id": "7388bcdbb934340525c046ca3673411be570391bcdb223e1aa68fcfeda107f8b",
"pubkey": "b93f691b77bb057f930582dd6333c5dba164a11f58ce5fef4fe3409066653e8e",
"created_at": 1682428459,
"kind": 1,
"tags": [
[
"e",
"a911b972b8da9e799e138913e81f183e26db60a76052897f706e73f17bb346b9"
],
[
"e",
"e4ca3bbc7e01322b97f4e52e82b32f4245209bda80060876b9c13941498a2374"
],
[
"p",
"70f446757f5e67763b0aecd8e5070f68797ef9ceff5af4bdb16a26217b01f5a8"
]
],
"content": "Yep! So I'll just focus on p2wpkh. The locking script for those UTXOs looks like this: 00 14 \u003c20 byte pubKeyHash\u003e. Old nodes interpret it as, push an empty array to the stack then push 20 bytes (convert 16 from hex to decimal) to the stack. They think that anybody can spend this UTXO because it doesn't have any signature checks! Even a signature field with just 00 would be valid according to their rules. If old nodes could think like a human, I like to picture them looking at the current blockchain and being so confused as to why all of these transactions are happening without signatures. In reality, most of the nodes are upgraded to segwit. These segwit nodes require an additional field on the transaction called a witness (old nodes never even see this). When a segwit node verifies the same transaction, it will verify that the witness field contains a public key that hashes to correct value and has valid signature.",
"sig": "47b1f042d501f5840cc3448c1a06b118f00a96beea38785c0ad12c35566aead49ce3b42a554f201e03991df7ad5ec40f1dd3abce4e18af21ce42be0ee5f40f96"
}