Dissecting a P2PKH Bitcoin Transaction down to the last Byte

René Pickhardt · 16K views · 2018 · 7:10

Open on YouTube

CryptographyDistributed systemstutorial

Why Bitcoin Stack Exchange recommends it

Bitcoin Stack Exchange users link it when someone needs to read raw transaction hex or understand how P2PKH locking and unlocking scripts execute.

Recommended by 2 people across 3 different months, 2019 to 2023.

What it is

A 7-minute screencast by Bitcoin developer and researcher René Pickhardt that walks through a real pay-to-pubkey-hash transaction byte by byte. It covers the transaction format and shows how a node validates it by combining the input and output scripts, including how the address is derived from the public key.

What people said

Recommends Rene Pickhardt · 2019-03 · Bitcoin Stack Exchange · on “Can someone help me understand what these scripts mean?”

Can't believe that this was not a duplicate. I will add a link to a video in which I dissect a pay2pkh tx: [this video] that should help to understand how these op codes work

Recommends Rene Pickhardt · 2019-05 · Bitcoin Stack Exchange · on “How to extract raw script from tx messages when the output script starts with 0xA9?”

This seems to be a classical P2PKH script which start with op_dup flowed by op_hash160 if you look at the next byte there is the hex value 14 which is 20 in decimal and means read 20 byte of data and push it to the stack. I have created a video in the past showing step by step how to dissect a P2PKH tx. Look: [this video]

Recommends Martin Thoma · 2021-04 · Bitcoin Stack Exchange · on “How are the unlocking script + locking script executed?”

I just wanted to verify the input of transaction 7de75 [LINK] . The related output is index 10 of transaction 00f64 [LINK] . The locking script defined in 76a91 (index 10) is: OP_DUP OP_HASH160 7ddb236e7877d5040e2a59e4be544c65934e573a OP_EQUALVERIFY OP_CHECKSIG The unlocking script in 7de75 is: 3045022100b7393ff959120e3ccb5284e3cf2eaa200235643a1549a4e6faaa911619089e2b02207b677827c7beeb53503e016a8dd29164d07cb79f0f1e058df9b8dfa3568d029001 04c4b7a7f7bb2c899f4aeab75b41567c040ae79506d43ee72f650c95b6319e47402f0ba88d1c5a294d075885442679dc24882ea37c31e0dbc82cfd51ed185d7e94 I've concatenated both: 3045022100b7393ff959120e3ccb5284e3cf2eaa200235643a1549a4e6faaa911619089e2b02207b677827c7beeb53503e016a8d

Cites ifuensan · 2023-10 · Bitcoin Stack Exchange · on “Stuck dissecting a P2PKH Bitcoin transaction, what am I doing wrong?”

I'm attempting to dissect a P2PKH transaction based on guidance from Rene Pickhardt's video ( link [this video] ). At around the 2:54 minute mark, he calculates the Bitcoin Address from the input. I'm interested in understanding the process behind obtaining the address. Here's the transcription: pubkey: 03486669962008e0713660b6d69117a65fcecd221d06c1e5077b4d9cd477c0cf98 Check the bitcoin address from the input: RIPMED160(SHA256(pubkey)): CB226B9CC60C613DDDCB188E984F631764CEF143 Extend with version: 00CB226B9CC60C613DDDCB188E984F631764CEF143 Calculate checksum: SHA256(SHA256(extended Pubkey)): CE281C015A7230F46041D2DD640A6714725C25A0ED674D5E215318AA206A397F Checksum = first 4 Bytes: CE281C01 Addres