How Cryptocurrency Works
Cryptocurrency is used for direct peer-to-peer payments anywhere in the world. The speed of transactions varies based on currency and confirmation requirements, but it’s generally very fast compared with traditional banking systems. Where banks can take days to transfer money, cryptocurrency transfers happen in minutes.
In general, cryptocurrency transactions go through the following steps before they get added to the blockchain.
- A person requests a transaction, and the request is sent to the entire network.
- Each computer on the network collects all concurrent transactions into a block, along with a timestamp for each transaction.
- Each computer works on solving the difficult math problem to add the block to the blockchain. This process is called “mining.”
- Once a computer finds a valid solution, it broadcasts the block to the rest of the network.
- The network checks the solution as well as compares transactions in the block against the current blockchain to prevent double spending.
- The block is added to the chain, showing the transaction was completed.
Once a block is added to the chain, that block gets hashed and is used to create the next block. The process continually repeats itself.
As such, transactions are practically irreversible, much the same way as if you give someone cash (hence calling it an electronic cash system). As mentioned, the chaining of one block to another means someone would have to edit the entire chain of blocks to change a transaction.
Since blocks are continually added to a chain, it’s extremely unlikely someone will be able to propagate an updated chain of blocks to the network before the rest of the network produces the next block and extends the chain further.
Every transaction needs a signature
Just as credit cards use your signature to verify you authorized a purchase, cryptocurrency uses a signature as well — a digital signature.
Transactions are secured through a cryptography system called public key encryption. Each user has both a public key and a private key associated with his or her account.
To authorize a transaction, users must prove they know their private key by using it as an input into a cryptographic hash function similar to the one used to link blocks together in the blockchain. That’s called signing the digest. The private key is used to write that “digital signature,” so it’s very important that the private key remains private.
The public key, which is available to all computers on the network, is used to decrypt the data and confirm that the private key associated with the account requesting the transaction was used to encrypt it. The public key, however, cannot be used to determine the private key, ensuring the security of one’s cryptocurrency holdings.
Source: The Motley Fool