Handcraft raw transactions PART 1 : P2PKH

Transaction aggregation Next to the fifth session of Shiba to Lion, it seems usefull to dispense a guide to go deeper in making raw Bitcoin transactions.

Pay to Public Key Hash (P2PKH)

There is a consensus on transactions’ structure in the Bitcoin network, and more precisely on the locking script in output(s) created by a transaction : you cannot handcraft a transaction with a non-standard script_pubkey, you must follow a standard. P2PKH is one of them : it provides a way to lock coins stored in an output so that only the chosen hash of a public key (also known as an address) will be able to unlock it, or more precisely sign it with the corresponding private key.

Let’s get real

Here is a step by step guide about how to handcraft a Bitcoin P2PKH transaction.
Here is the code used during the shiba to lion workshop to handcraft raw Insacoin transactions.