Darren Wurf
So I had some questions...
- What are blockchains?
- What makes them different?
- How do they work?
Something to do with cryptocurrency?
So I had some questions...
- What are blockchains?
- What makes them different?
- How do they work?
A blockchain is a shared ledger where each new block of transactions is signed with a Nakamoto signature.
Two concepts: Shared ledger, and Nakamoto signature
The shared ledger can be seen as a series of blocks, each of which is presented for signing when it is created. Each block consists of a set of transactions, and each block is built on the previous blocks.
Each block changes the state of the accounts by moving money around. We can create the next block by filling it with transactions, and signing it with a Nakamoto signature.
I considered these other explanations as well, taken from the SALT whitepaper: 1. Executive view: A blockchain is a shared decentralized ledger, enabling business disintermediation and trustless interactions, thereby lowering transaction costs 2. The IT architect and data management view: A blockchain is a shared append-only distributed database with full replication and a cryptographic transaction permissioning model. 3. The blockchain developers and technology view: A blockchain is a peer-to-peer protocol for trust-less execution and recording of transactions secured by asymmetric cryptography in a consistent and immutable chain of blocks.
A Nakamoto signature is a device to allow a group to agree on a shared document. To eliminate the potential for inconsistencies (disagreement), the group engages in a lottery to pick one person's version as the one true document.
The lottery is effected by all members of the group racing to create the longest hash over their copy of the document. The longest hash wins the prize and also becomes a verifiable 'token' of the one true document for members of the group: the Nakamoto signature.
The "longest hash" explanation didn't make sense until I realised they meant the hash of each block joined together.
Blockchains provide a timestamped ledger with shared-write capability to entities who do not trust each other.
So I had some questions...
- What are blockchains?
- What makes them different?
- How do they work?
Is it a database? Maybe I should compare blockchains to a database
Properties of blockchains:
Downsides of blockchains
So I had some questions...
- What are blockchains?
- What makes them different?
- How do they work?
Maybe looking at the data structures will help me understand
- Chain
- Blocks
- Mempool
- Transactions
- Merkle trees
version | hashPrevBlock | hashMerkleRoot | nTime | nBits | nNonce |
tx0 (coinbase) | tx1..n |
The first transaction is called the coinbase and is allowed to create new bitcoin.
// Bitcoin block header int32_t nVersion; // Block version char[32] hashPrevBlock; // sha256 char[32] hashMerkleRoot; // sha256 uint32_t nTime; // Unix timestamp uint32_t nBits; // Difficulty target uint32_t nNonce; // Increment nonce to "mine" (change the hash)
They allow us to hash only the headers.
Inputs: Source code doesn't contain "coins" as a concept, uses utxo
Outputs include change from the transaction
Cryptographic proof of ownership
Owner 1 wants to send to owner 2:
** Recipient's public key
** Owner 1's Digital Signature of:
** * Proof of ownership (previous transaction, first block)
** * Recipient's public key
Lose your private key -> lose your money
Private key stolen -> lose your money
version | hashPrevBlock | hashMerkleRoot | nTime | nBits | nNonce |
Complex topic. Important points: * Only the block header is hashed * Transactions can be pruned * Merkle tree is magic that can prove a transaction belongs to a block header
Space | Forward |
---|---|
Right, Down, Page Down | Next slide |
Left, Up, Page Up | Previous slide |
G | Go to slide number |
P | Open presenter console |
H | Toggle this help |