Understanding Bitcoin Transactions
AI Summary
Key Insights
- Bitcoin builds upon the idea of an append-only ledger, decentralized consensus protocol, and miners validating transactions.
- Bitcoin's transaction model is based on inputs and outputs, involving scripts for complex transactions like joint payments and escrow transactions.
- The Bitcoin network operates as a P2P network with ad-hoc protocols and random topology, where nodes propagate transactions using a flooding mechanism.
- The lecture discusses fully-validating nodes and SPV clients. It also delves into the limitations and improvements such as hard forks and soft forks.
- Hard-coded limits in Bitcoin includes 10 minutes average creation time per block, 1 M bytes in a block, and 23M total bitcoins maximum.
Loading...

Loading...

Loading...

Loading...

Loading...

Loading...
![A transaction-based ledger (Bitcoin)
Inputs: Ø
Outputs: 25.0→Alice No signature required
Inputs: 1[0]
Outputs: 17.0→Bob, 8.0→Alice
SIGNED(Alice)
SIMPLIFICATION: only one transaction per block
time
is this valid?
finite scan to
check for validity Inputs: 2[0]
Outputs: 8.0→Carol, 7.0→Bob
SIGNED(Bob)
Inputs: 2[1]
Outputs: 6.0→David, 2.0→Alice
SIGNED(Alice)
we implement this
with hash pointers
change address
1
2
3
4](https://d2z384uprhdr6y.cloudfront.net/1cFn6GKWDmhEzGI_xcNQpjFKuPOzROutQbR7gSIMu5M/rt:fill/q:100/w:1280/h:0/gravity:sm/czM6Ly9qYXVudC1wcm9kdWN0aW9uLXVwbG9hZHMvMjAyNS8wMS8yMC82N2M1YzYzZi03OGUxLTQ0ZmEtOWRlOS1kMzJhZTE1NGQ4Nzcvc2xpZGVfNi1sLndlYnA=.webp)
Loading...
![Merging value
Inputs: ...
Outputs: 17.0→Bob, 8.0→Alice
SIGNED(Alice)
SIMPLIFICATION: only one transaction per block
time
Inputs: 1[1]
Outputs: 6.0→Carol, 2.0→Bob
SIGNED(Alice)
Inputs: 1[0], 2[1]
Outputs: 19.0→Bob
SIGNED(Bob)
..
.
..
.
1
2
3](https://d2z384uprhdr6y.cloudfront.net/A3QexlhSQgXNpdtJ2aN8BYvzJj3IYOqF1lgX33LJsdY/rt:fill/q:100/w:1280/h:0/gravity:sm/czM6Ly9qYXVudC1wcm9kdWN0aW9uLXVwbG9hZHMvMjAyNS8wMS8yMC82N2M1YzYzZi03OGUxLTQ0ZmEtOWRlOS1kMzJhZTE1NGQ4Nzcvc2xpZGVfNy1sLndlYnA=.webp)
Loading...
![Joint payments
Inputs: ...
Outputs: 17.0→Bob, 8.0→Alice
SIGNED(Alice)
SIMPLIFICATION: only one transaction per block
time
Inputs: 1[1]
Outputs: 6.0→Carol, 2.0→Bob
SIGNED(Alice)
Inputs: 2[0], 2[1]
Outputs: 8.0→David
SIGNED(Carol), SIGNED(Bob)
..
.
..
.
two signatures!
1
2
3](https://d2z384uprhdr6y.cloudfront.net/L89jyRMry4AmMv2tgiyBv1fuUXTBGptaNXgaDupM7Uw/rt:fill/q:100/w:1280/h:0/gravity:sm/czM6Ly9qYXVudC1wcm9kdWN0aW9uLXVwbG9hZHMvMjAyNS8wMS8yMC82N2M1YzYzZi03OGUxLTQ0ZmEtOWRlOS1kMzJhZTE1NGQ4Nzcvc2xpZGVfOC1sLndlYnA=.webp)
Loading...
![The real deal: a Bitcoin transaction
{
"hash":"5a42590fbe0a90ee8e8747244d6c84f0db1a3a24e8f1b95b10c9e050990b8b6b",
"ver":1,
"vin_sz":2,
"vout_sz":1,
"lock_time":0,
"size":404,
"in":[
{
"prev_out":{
"hash":"3be4ac9728a0823cf5e2deb2e86fc0bd2aa503a91d307b42ba76117d79280260",
"n":0
},
"scriptSig":"30440..."
},
{
"prev_out":{
"hash":"7508e6ab259b4df0fd5147bab0c949d81473db4518f81afc5c3f52f91ff6b34e",
"n":0
},
"scriptSig":"3f3a4ce81...."
}
],
"out":[
{
"value":"10.12287097",
"scriptPubKey":"OP_DUP OP_HASH160 69e02e18b5705a05dd6b28ed517716c894b3d42e OP_EQUALVERIFY OP_CHECKSIG"
}
]
}
input(s)
metadata
output(s)](https://d2z384uprhdr6y.cloudfront.net/cCQEEhjdOMKsqMLU0VK6dI59e39N5OTbxbYPJgN6t7w/rt:fill/q:100/w:1280/h:0/gravity:sm/czM6Ly9qYXVudC1wcm9kdWN0aW9uLXVwbG9hZHMvMjAyNS8wMS8yMC82N2M1YzYzZi03OGUxLTQ0ZmEtOWRlOS1kMzJhZTE1NGQ4Nzcvc2xpZGVfOS1sLndlYnA=.webp)
Loading...

Loading...
![The real deal: transaction inputs
"in":[
{
"prev_out":{
"hash":"3be4...80260",
"n":0
},
"scriptSig":"30440....3f3a4ce81"
},
...
],
signature
previous
transaction
(more inputs)](https://d2z384uprhdr6y.cloudfront.net/bpXJpyH1MFPiZKHYjnnTxyiYBzUaNe6vaNkCnAgCRpg/rt:fill/q:100/w:1280/h:0/gravity:sm/czM6Ly9qYXVudC1wcm9kdWN0aW9uLXVwbG9hZHMvMjAyNS8wMS8yMC82N2M1YzYzZi03OGUxLTQ0ZmEtOWRlOS1kMzJhZTE1NGQ4Nzcvc2xpZGVfMTEtbC53ZWJw.webp)
Loading...
![The real deal: transaction outputs
"out":[
{
"value":"10.12287097",
"scriptPubKey":"OP_DUP OP_HASH160 69e...3d42e
OP_EQUALVERIFY OP_CHECKSIG"
},
...
]
output value
recipient
address??
(more outputs)
more on this soon...
Sum of all output values less than or equal to sum of all input values!
If sum of all output values less than sum of all input values, then difference
goes to miner as a transaction fee](https://d2z384uprhdr6y.cloudfront.net/VRofS_FUUNOynuiAJ9yMV16Ax3RUjUniHI2PMam5Yzk/rt:fill/q:100/w:1280/h:0/gravity:sm/czM6Ly9qYXVudC1wcm9kdWN0aW9uLXVwbG9hZHMvMjAyNS8wMS8yMC82N2M1YzYzZi03OGUxLTQ0ZmEtOWRlOS1kMzJhZTE1NGQ4Nzcvc2xpZGVfMTItbC53ZWJw.webp)
Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...
![The real deal: a Bitcoin block
{
"hash":"00000000000000001aad2...",
"ver":2,
"prev_block":"00000000000000003043...",
"time":1391279636,
"bits":419558700,
"nonce":459459841,
"mrkl_root":"89776...",
"n_tx":354,
"size":181520,
"tx":[
...
],
"mrkl_tree":[
"6bd5eb25...",
...
"89776cdb..."
]
}
transaction
data
block header](https://d2z384uprhdr6y.cloudfront.net/KZWDJxHAsDzw60sS8udN6PJmc9D7xfSJUOIg_20KNv0/rt:fill/q:100/w:1280/h:0/gravity:sm/czM6Ly9qYXVudC1wcm9kdWN0aW9uLXVwbG9hZHMvMjAyNS8wMS8yMC82N2M1YzYzZi03OGUxLTQ0ZmEtOWRlOS1kMzJhZTE1NGQ4Nzcvc2xpZGVfMzUtbC53ZWJw.webp)
Loading...

Loading...

Loading...

Loading...

Loading...

Loading...
