There are two types of transactions, on-chain and off-chain transactions. On-chain transactions are recorded on blockchain while off-chain transactions are not.
On-chain transactions are the transactions available on blockchain (distributed ledger) and are also visible to all nodes on the blockchain network. The biggest problem for on-chain transactions is their cost, which depends on the length of transaction in bytes. If the data is too big, then it will be financially suicidal to save them on a public blockchain.
This is because the replication factor is very high (Xnode number must be saved as chaindata forever for every node).
On the other hand, when we say off-chain transactions or data, we are referring to data which are not on blockchain, but somehow they are committed on blockchain. Normally, we store a hash, produced of a large off-chain data. This must be done to prove that we didn’t alter the data later (preserving immutability property). If you edit the data in a database or a file without any other actions, then no one will know or be able to prove that data has been altered.
Off-chain transactions eliminate the need to record their full data on blockchain or be included in a block, which leads to a very high number of transaction speed. This fact may lead to a wider adoption of blockchain solutions that could enable blockchain technology to become easily acceptable and more widespread.
However, off-chain transactions have both advantages and disadvantages,
The advantages of off-chain transactions are:
- Faster
- Easier to read — easier for developers as it is no need to touch blockchain and API from the server is enough to return the data
- Cheaper — the cost can be close to zero
- Privacy — transfers and other transaction types are not visible on the public blockchain
While the disadvantages of off-chain transactions are:
- Off-chain transactions drop transparency in favor of privacy (read access is permission)
- Off-chain transactions are usually centralized; the entity who poses the data can deny access, destroy the data or just cease functioning. Complex layers and architecture can keep off chain transactions decentralized though
- There is no guarantee that the data can be saved forever because they are not on blockchain
In short, off-chain transactions are executed instantly as compared to the on-chain transactions that can lag for a long time depending on the number of transactions waiting to happen on the same network as well as the network load and unconfirmed transactions waiting in memory pool.
Stay tune for more information about #ECOC #ECOChain