|
|
|
|
|
by Jasper_
3212 days ago
|
|
The core idea is that there are a number of coins "floating out there in the open" which you can use in your transactions, as Inputs. These Inputs can be used in transactions as long as you publish data which can solve a riddle put forth by a Script. So, your balance is basically any those which you can easily use as Inputs. The most traditional way of tracking this is that you use a standardized script format called P2PKH (Pay 2 Public Key Hash), and software like a wallet scans the transactions for any scripts that have your public key mentioned in a P2PKH template. So, once you want to send money to someone else's wallet, you answer the riddle of the script (in P2PKH's case, by signing something and proving you own the public key) allowing you to do whatever you want to that Input. A key thing is that if someone pays you 3BTC and someone else pays you 2BTC, then you have 5BTC in combined inputs. To pay someone else 4BTC, you use both those Inputs and make two new ones: 4BTC P2PKH to someone else's public key, and 1BTC back to your own "change address", which is just an Input that you can reuse again. A wallet broadcasts transactions into the network, where they float around until a miner takes those transactions, puts N of them into a block, then, as part of that block, they can use an extra magical coinbase Input which gives them 12.5BTC out of thin air (originally 50BTC, halves every so often) which they can lock under any script they want. |
|