How Bitcoin works [Mechanics]
Collective Entries of Records of Transaction Histories in a Ledger
(The Chain can be thought of as a Collective Memory of the Path of the Coins)
A transaction is just a is digital declaration of a party of its intent to transfer a certain number of bitcoins to another party, thus a completed transaction is when the assigned coins have been confirmed as owned by the receiving party on the chain.
Technology
Bitcoin uses public-key cryptography, peer-to-peer networking, and proof-of-work to process and verify payments.
Authorization:
Bitcoin Uses an Ecliptic Curve Digital Signature Algorithm1 for its cryptography (ECDSA) & a
Peer to peer consensus system to validate accounts and transactions
An ECDSA Signature is a value that could only reasonably have been created by someone who has the private key that generated the public key. Bitcoin uses the secp256k1 curve to generate the public key pairing from a private key.2
Hash Functions:
++ Use in Digital Signatures
SHA 256 – Digest is Exactly 256 Bits in Length, Arbitrary Input Length
What Happens in a hash Function?
Ideally there are Certain Design Goals for Cryptography Functions
Accounts
An Account can be thought of essentially as a distinguishable Identity that corresponds to a Public Verification Key and Private Secret Signing Key
Signature
A Digital Signature is a mathematical mechanism for combining a public sequence of numbers with a digital message
A method that binds a public verification key to the owner, and allows the owner to sign messages as valid using their private signing key.
Keys
Create Two Keys with a Mathematical Relationship
SK: Signing Key (Private Key)
VK: Verification Key (Public Key)
Should be hard to come up with the Private Key if you only have the Public Key
RSA
Originally created by Rivest, Shamir and Adleman. RSA is an Asymmetric Cryptography Algorithm.3 Meaning that there are two keys used in the formula.
One Key to Encrypt (The Public Key: VK) and the other Key to Decrypt (The Private Key: SK)
It is based on the mathematical principle that multiplying large numbers is easy to do, but finding the factorials of large numbers is very difficult to do. AKA Prime Factorization4
Sending
A sending transaction is an entry in the blockchain ledger of assigning coins/tokens to another party.
The sending process also incurs a transaction fee as an incentive for others in the network to validate it
How it Works
Signing Process: M ^ SK -> SM
Verification Process: M + SM + VK -> Yes or No
The digital signature between the two parties:
Take the Msg (Transaction Details) then Hash it, then Sign the Hash
Transaction Details:
It includes the transaction records for the bitcoins Assigned to that account along with a cryptographic guarantee that the sending party actually has the bitcoins it is sending.
Process
Pays to PubKey Hash (P2PKH)
Currently the most common way users exchange payment information.5
The standard Pay-To-Public-Key-Hash6 (P2PKH) transaction type lets you spend coin to a typical Bitcoin address, and then the receiver can further spend those coins using a simple cryptographic key pair.
TXID’s and UTXO’s
bitcoins sitting dormant in your wallet (or the amount of coin that is assigned to your account address) is called an Unspent Transaction Output (UTXO)
Every time you send bitcoin to another party you have to include a Transaction Identifier (TXID) to prove that the coin does in fact belong to you.
Essentially every transaction has to include all the bitcoin you have that is assigned to your address. Once spent the remaining balance from the transaction is re-assigned to you.
Receiving
Check the numbers work out correctly
Some mathematical assurance that the assigned value is correct
Doesn’t not know immediately if it double spent or not so waits for it to be confirmed as an immutable entry on the blockchain.
Blocks
If a transaction can be represented as an entry in the ledger
Then each block can be represented as a page in the ledger
All transactions are public and timestamped
The Genesis Block
The initial parameters for laws of the entire ecosystem
How is new Coin Minted?
Creating bitcoin _> Block Rewards
How is old Coin Burned?
Destroying bitcoin _> Technically can’t be destroyed
Introduction to Bitcoin: Assignments Pt. 1
Proof-of-work (mining), blocks (timestamping), blockchains, and block-body data structures (Merkel trees) that were introduced in course 101.
This section deals with Bitcoin’s blockchain implementation details and the contents of its blocks.
Written assignments