In the last three threads we have seen about WEB3, BLOCKCHAIN and CRYPTOCURRECNY.
Today let's see about the the very first decentralized cryptocurrency ever created which is Bitcoin.
"WTF is BITCOIN?"
1/
@Bitcoin was introduced to address the root problem with conventional currency and the trust that is required to make it work.
You can read this thread to understand how currency evolved over time 👉 bit.ly/WTFisCRYPTOCUR…
In General trust make systems brittle.
2/
@Bitcoin@Bitcoin originally was proposed in 2008 whitepaper* "Bitcoin: A Peer-to-Peer Electronic Cash System" by a person, or group of people, using the alias "Satoshi Nakamoto". It was launched in January 2009.
*Whitepapers explain the purpose and technology behind a project.
3/
@Bitcoin Bitcoin is a decentralized digital currency that enables instant payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate with no central authority: transaction management and money issuance are carried out collectively by the network.
4/
@Bitcoin Bitcoin is designed around the idea of using cryptography to control the creation and transfer of money, rather than relying on central authorities
Distributed cryptocurrency was first described in 1998 by Wei Dai weidai.com/bmoney.txt on the cypherpunks mailing list
5/
- Lets assume there are 4 friends Alice, Bob, Charlie and you
- Everytime you guys exchange money, it will be inconvinient exchange each time in cash?
- So decided to use a communal ledger that records all payments that you intend to clear
6/
@Bitcoin - Ledger will be public and accessible to everyone, and can add a new line
- At the end you guys decided to look all the transactions and decided to pay out. If you spend more than you reeive, you keep the money in pot and If you receive more than you spend you take from pot
7/
@Bitcoin The problem with this sort of public ledger is anyone can add line.
- Bob can add a line saying "Bob paid you $100" without your knowledge
- We lack the trust here, We don't know whether the line was added by the person who it was meant to be added
8/
@Bitcoin This can be solved by digital signatures in cryptography
- Like a handwritten signatures in the physical world, the idea here is that you should be able to add something next to a transaction that proves you saw and approved it which cannot be forged/tampered.
9/
@Bitcoin In general any digital data is just 0's and 1's, So can't the digital signature just be copied and forged?
- Well in cryptography, everyone has their own public and private key pair
- Where private key is only known to your and public key intend to be publicly known
10/
@Bitcoin - In real world your signature looks same in what ever document you sign
- But the digital signature you do using your public/private keys it changes completely even for the slightest change to your message you are signing
- In bitcoin the digital signature is 256 digits
11/
@Bitcoin In general any digital signature scheme will consist of two functions, one to produce a signature on a message, and another to verify that a signature is valid.
✅Sign(Message, private key) = Signature
✅Verify(Signature, Message, public key) = True/False
12/
@Bitcoin The basic idea is to make it infeasible to find/guess the signature
- So in bitcoin the number of possibilities of the signature to guess is 2^256
- Bitcoin uses the Elliptic Curve Digital Signature Algorithm using the curve Secp256k1 and the hash function SHA256
13/
@Bitcoin This alone doesn't guarantee that the data cannot be forged.
For example You sign a transaction "You pay Alice $50" and add to the ledger.
Now Alice cannot add a new line just like that because of this signature thing but what if Alice just copies the line inserted by you
14/
@Bitcoin To solve this, when you sign a transaction, include an unique ID associated with that transaction.
That way, if "You pay Bob $100" multiple times, each transaction requires a completely new signature.
Now we have huge aspect of trust because of this digital signatures
What if one of your friend charlie with a lot of debt doesn't want to pay at the end when you guys tally and runs away
To solve this, We can check the "overdrawn" condition something similar to "Double spend" condition in the real world
16/
@Bitcoin - In the start system knows balance of every account
- On each and every transaction, system verifies if the payment is valid or not by checking all of his previous transactions with the balance
- If user spends more than they have then transaction is marked as invalid
17/
@Bitcoin ONE THING TO REMEMBER IS "BITCOIN IS JUST A LEDGER", The exchange for bitcoin to real world currency is like the conversion of EURO to USD and vice versa., on open market.
To “own” a Bitcoin just means having a positive balance on the Bitcoin ledger
18/
@Bitcoin We have solved one form of trust issue, But there is one more:
- Where the ledger is being hosted, if it is on one server it is just being owned and controlled by the owner of that server
- Owner can do what ever they want
- So we have to trust that owner as well
19/
@Bitcoin We can solve this by making it decentralized:
- Keeping a copy of each ledger with every participant of that network
- When ever a new line is to be added to the ledger, The signer will broadcast the message to every other participant in that network
How to make sure that data in each ledger is same all the time
or
To make everyone agree on which ledger is the valid one
Like for example you hear multiple transactions, but not sure whether the same were heard by every other participant.
21/
@Bitcoin To solve this "Satoshi" described a protocol in the original bitcoin whitepaper called "PROOF OF WORK"
- This protocol solves the problem of which ledger to be trusted
- The protocol says TRUST which ever ledger has the most computational work put into it.
22/
@Bitcoin Because to make a fradulant transaction to be valid it requires a infeasible amount of computational work
- The computational work involves cryptographic hash functions
- Hash function takes input of any message/file and the output is a string of fixed length called hash
23/
@Bitcoin - Everytime Output looks random but with the same message the output will always be same
- Even if a single character is edited in the message whole output will be changed
- This cryptographic hash function is infeasible to compute in the reversse direction
24/
@Bitcoin ofcourse there is no hard proof that it is not possible to compute in reverse direction but it makes very very hard and requires a way much resources that we have in our generation
So how exactly does this hash function help solve our problem👇
25/
@Bitcoin If you remember in the tweet 15/ of this thread we said we add a unique ID to the ledger which makes the signature change.
Well let see how we select that unique ID specific to Bitcoin: If you compute the hash of the ledger with the newly added ID the first 30 shoule be 0
26/
@Bitcoin - The probability of finding that unique number which will effect the output to have 30 zeros in the starting is 1/2^30 which is like 1 Billion.
- So to find that number it takes lot of computation power because they have to go through ~1 billion combinations
27/
@Bitcoin Since this involves a lot of WORK to verfity that it is valid this process if called "PROOF OF WORK"
So even if a single character is chaged in the message later, it has to go through the entire process of changing the hash, guessing the unique number etc.,
28/
@Bitcoin First organize the given ledger in to BLOCKS, where each block consists list of transactions together with proof of work(that unique id)
The block is valid only if it has proof of work
To make it systematic, every block should refer to the hash of the previous block
29/
@Bitcoin Since it looks like a chain, because of those references to the previous blocks now on the ledgers combinely called BLOCKCHAIN.
if you need more info on BLOCKCHAIN please go ahead and read this thread 👉bit.ly/WTFisBLOCKCHAIN
30/
So called block creator(Miner) listens to the transactions being broadcasts and then calculates the unique number(proof of work) by doing a lot of work.Once it is done the block then will be broadcasted to everyone.
This is called Mining
31/
@Bitcoin Since this involves a lot of work the miner will be rewarded by system allows the creator to put a special transaction on top of the list which is like "Miner 1 gets 10 Bitcoin".
This is called block reward :
- It has no sender/signature
- Adds to total supply
32/
@Bitcoin The blocks that are valid and are added to the network depends on Proof of work.
This process of agreeing on which is valid in a decentralized way is called CONSENSUS.
There are different types of CONSENSUS algorithms out but bitcoin was intoduced with "PROOF OF WORK"
33/
@Bitcoin one more thing to remember:
-The way of deciding the number of zeros at the start of hash varies.
- In bitcoin blockchain the number of zeros will increase as the number of miners keep incereasing so as to keep the idle time of adding block is always ~10 minutes
34/
@Bitcoin For Every 210,000 blocks i.e., ~4 years the block rewards will be halved
So right now the blockrewaard might be 6.25 per block.
Normally our programs and processes run locally in our system, but there are some protocols that support execution in a remote system. Such as RPC protocol, which makes it easy for the peer-to-peer networks.
Networking is the word we use when we talk about connecting computers together so that they can share data with each other.
Local networks range from simple networks consisting of two computers to networks connecting hundreds of thousands of devices
2/
Who owns the internet?
internet is not owned by any individual or group.
The internet is a worldwide collection of interconnected networks (network of networks), cooperating with each other to exchange information using common standards
3/
You might have interfaced with Linux many times before because so many devices run Linux.
Phones, TVs, Point-Of-Sale devices, Networking devices, Game consoles, In-flight entertainment systems as well as stock exchanges.
2/
You might have also heard about the recent buzzword "cloud", which is just a Linux system.
Your favorite applications on the internet like mail, productivity suites, watching entertainment every product run in the cloud on Linux based systems.
3/