How do they work? Where do they come from? Why do some look different than others?
Thread 👇
You can think of an Address kind of like a Lock
When we say that an Address “has some bitcoin on it”, what we really mean is that a certain amount of bitcoin is locked to that Address
Let’s pretend our friend Alice owns this Address:
1mEBFZ2iGmrDL6GXmrCAM8ZJdg7XVYdCM
Addresses that start with a 1 are the most basic and are called "Pay to Public Key Hash" addresses, and require just one signature in order to unlock them
For some background on what Public Keys and Signatures are, I'd suggest checking out my previous thread:
Good question
It wasn’t until a little later that they realized hashing the public key provides some additional security benefits that make it more future-proof, so "P2PKH" became the standard
How does Alice spend from this Address?
To send a transaction, she needs to produce 2 things:
- Her actual Public Key
- A Signature of the spending transaction's data (signed by her Private Key)
Then all the Nodes’ software in the bitcoin network will check to make sure its valid
- Does hashing the Public Key she provided equal the Hash thats in the Address?
- Is the Signature valid for that Public Key?
She will have successfully “unlocked” her Address and spent from it!
What about the other ones?
The next type are addresses that start with a "3", like this one:
32XsF8Ge2goSWiHKfwakMwQXTHawehzoFV
It gets it’s name because the data encodes a Hash of a computer Script. Thats right - a miniature computer program!
- She must produce the actual Script that hashes to the data in the Address
- She must produce any signatures or other secret information that the Script requires
The program must evaluate to True in order for the transaction to be valid
The most common one is a "Multi-Signature" script, which requires Signatures from multiple different parties in order to Spend
bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej
These, which start with "bc" are called “Segregated Witness” addresses, and they have similar functionality to the previous ones I described
When you spend from them, you don’t get charged for the Signature data (remember in bitcoin you pay for data!)
- Pay to Public Key Hash ("P2PKH") (1 key required)
- Pay to Script Hash ("P2SH") (Mini computer script required)
- Segregated Witness ("Segwit") (Same possibilities as above, but save money on fees)
We can dive deeper in further threads, but I'll end it here
Let me know your questions in the comments!
P2PKH addresses *were* part of bitcoin from the beginning
P2PK was used as well, but only indirectly
See comments for the details :)


