Bitcoin is a form of digital cash that allows two people made online payments to be between each other - a seller and a buyer. It works on the principle of a "distributed ledger" into which transactions and account balances are recorded.
The Bitcoin protocol works on the basis of the principles of cryptography and defines the procedure for generating, confirming and recording each individual money transfer. There is no need to provide a specific program code - it is freely available in the form of a "white paper" - "Bitcoin: A Peer-to-Peer Electronic Cash System". ”However, you can understand its features by understanding the order of formation of transactions and further actions of blockchain participants with them.
They contain the following information:
- A unique identifier generated by double passing information through the SHA256 hash function.
- Deposit. Or a Bitcoin address that identifies the source of the bitcoins to be transferred. Most often it is a withdrawal from previous transactions and is used to check the reality of the sender and the availability of the necessary funds in his account.
- The number of bitcoins to be transferred to another address.
- Withdrawal. Or the recipient's Bitcoin address.
The withdrawal of one transaction can be used as a deposit for another - this creates continuity in the chain and allows you to track the path of Bitcoin movement along the blockchain.
Verification of transactions
All transactions of the blockchain network must be valid for the authenticity, focus and availability of real cryptocurrency assets. This process is not centralized - all network nodes are involved in it.
The account that initiates the process is identified by the bitcoin address and a pair of keys - private and public. To pass authentication, the sender marks the cryptocurrency transfer with a digital signature based on the private key. And any node in the network can use a public key that is known to everyone, can confirm or deny authenticity.
Cryptocurrency transfers do not go into the blockchain one by one - they are formed into lists called blocks. They are interconnected by a chain - a blockchain. All those transactions that have already been sent to the network, but have not been added to the list and have not been confirmed, are reversible.
The miners verify the authenticity of each money transfer and add it to the block. Each of them must receive a certain number of independent confirmations.
Each computer connected to the network stores an up-to-date copy of the entire blockchain, which is updated as new information becomes available. In the process of forming a new block, it is necessary to additionally solve a special mathematical and cryptographic problem called "proof of work". The miner who copes with it first receives a reward after other nodes confirm the veracity of his calculations.
What is the protocol?
From the point of view of the process of creating and validating transactions, the Bitcoin protocol can be formulated as follows:
- Each new transaction is transmitted to all nodes in the network.
- Each node collects all new transactions into a block.
- Each node tries to find a hash solution first in order to get a proof of work.
- The first node that finds a solution transfers the finished block to the network.
- All nodes check the correctness of the calculations and accept, or don't accept a new block.
- Work begins on a new block. The hash of the newly calculated one is added to the new one, thus guaranteeing a continuous sequence.
The Bitcoin protocol is based on the joint maintenance and creation of a "distributed bitcoin ledger". Each transaction is firmly fixed in a new block, which is only confirmed when all cryptocurrency transfers are validated and the correct hash is calculated. All processes are checked by all participants in the network - this is the consensus algorithm.