Understanding On-chain and Off-chain Transactions
The Nature of Blockchain Transactions
The Blockchain Network is a distributed ledger for recording crypto transactions.
On-chain transactions are transactions recorded on the unalterable blockchain. Off-chain transactions are crypto transactions that move the value outside the blockchain. Each of these kinds of transactions has its unique benefit and is mostly employed based on suitability to the parties involved.
For this purpose, we will be taking a look at the uniqueness of both kinds of transactions. This will give us a proper idea of how they are applied and why each one may be preferred for a particular purpose.
📌 The Bitcoin blockchain network was built primarily to send money from one wallet to another without the need for a central authority or middleman, like a bank. It does this by combining cryptography, distributed networks, and a ledger to ensure that payments are sent directly from one party to another.
📌 When a payment is sent, the network first checks if the sender is authorized to send the payment by checking their wallet. If the currency in the sender’s wallet is above the amount they try to send, the transaction is approved. If not, the transaction is declined.
📌 In many cases, the use of codes or coupons can be adopted during off-chain transactions. These are redeemable codes or coupons that can be exchanged with the crypto assets
On-chain transactions are what we normally refer to as blockchain transactions. It is the most popular of the two transaction types and requires an overall update of the blockchain network.
For an on-chain transaction to be complete there has to be an agreed number of confirmations by miners. The time it takes for an on-chain transaction to complete also depends on network congestion. Therefore, sometimes transactions are delayed if there is a large volume of transactions that need to be confirmed.
However, if you want them to complete faster, you can pay a higher fee. On-chain transactions become implemented (and irreversible) only when more than 51% of the network’s participants have agreed that it is correct, and the ledger is fully updated.
How On-Chain Transactions Work
Blockchains are built on certain rules of engagement, called protocols that all transactions must obey. These rules vary from one blockchain to another, so what constitutes an on-chain transaction on one blockchain may not apply to another.
In essence, on-chain transactions are determined by the protocols of the blockchain.
To fully understand on-chain transactions, look at how transactions on the Bitcoin blockchain are processed.
The Bitcoin blockchain network was built primarily to send money from one wallet to another without the need for a central authority or middleman, like a bank. It does this by combining cryptography, distributed networks, and a ledger to ensure that payments are sent directly from one party to another.
Transactions are processed and published in blocks every 10 minutes and each block, 1Mb in size, consists of transactions. When a payment is sent, the network first checks if the sender is authorized to send the payment by checking their wallet.
If the currency in the sender’s wallet is above the amount they try to send, the transaction is approved. If not, the transaction is declined.
For the Bitcoin network to maintain its security, nodes must prove the authenticity of the transactions they process by providing proof of work. This proof is called a consensus protocol, i.e., a set of rules determining what transactions should be processed.
The Bitcoin network achieves this consensus by creating a hard cryptographic puzzle that all nodes or miners must compete to solve. This puzzle can only be solved by iteration (trial and error), which requires brute computational power.
The first node to solve this puzzle gets to process all the transactions in a block, after which all other nodes verify the transactions. After verification, the winning node publishes the block to the blockchain, gets rewarded with Bitcoin, and all other nodes update their copy of the ledger.
On-chain transactions on the Bitcoin network are highly unscalable. Nodes waste a lot of energy competing to solve the cryptographic puzzle, not to mention the 10 minutes they take to process transactions. This system is too slow and inefficient to cater to enterprise and global demand and to cater to this problem; off-chain transactions were created.
Off-chain transactions are the second blockchain transaction variation. They differ from on-chain transactions in several ways.
Off-chain transaction agreements happen outside the blockchain. This protocol employed with off-chain transactions is similar to what is used on payment platforms like PayPal.
The parties involved in the transaction can choose to have an agreement outside of the blockchain. The next step could also involve a third party, whose role is to confirm the completion of the transaction and certify that the agreement has been obeyed. This makes the third party a kind of guarantor in the transaction.
This is the model that is adopted by most decentralized exchanges today, where the exchange plays the role of an escrow. It provides the platform and rules for transacting. Once parties agree on terms outside the blockchain, the actual transaction is then executed on the blockchain.
In many cases, the use of codes or coupons can be adopted during off-chain transactions. These are redeemable codes or coupons that can be exchanged with the crypto assets. The third party holds the codes or coupons and is responsible for redeeming them at the right moment.
Off-chain transactions can also be executed via the exchange of private keys by the parties involved. Using this routine, the crypto assets involved will not leave the wallets. What happens is that ownership is changed without altering the blockchain. This makes the transaction instant and without delay.
How Off-Chain Transactions Work (The Lightning Network Example)
The Lightning Network requires a multi-signature address to facilitate transactions between parties on a channel. This address allows more than one private key to sign off/approve transactions. When two parties use the Lightning network, they use channels created between nodes, along with a transaction balance sheet.
Both parties need to deposit an amount of Bitcoin in the multi-sig wallet; the sum of both deposits must be greater than 0 Bitcoin, and this initial deposit is published on the blockchain to ensure transparency.
The crypto deposited by both parties is recorded on the balance sheet as each’s initial balance. Whenever a transaction is made, the balance sheet is updated, and both parties sign off on it with their private keys.
The amount exchanged between nodes on the network cannot be summed up to more than the initial deposit as more crypto isn’t added to the initial deposit but instead transferred from one node to the other.
At the end of the exchange or business, the final signed balance sheet is sent to the blockchain. The blockchain nodes verify the balance sheet and process it, and the amount in the multi-sig address is disbursed to the parties in the proportion stated on the final balance sheet.
Note that, just as there are nodes and users—which are separate entities—on the blockchain, there are also nodes and users on the Lightning network. Nodes on the Lightning network download the LN software and create channels between themselves and other nodes, while users have wallets that send and receive payments on the network.
Combining both On-chain And Off-chain Transaction Systems
For particular reasons, some platforms combine certain aspects of both on-chain and off-chain transactions to achieve what is known as hybrid transactions. This mostly happens when the conditions require instant transactions that are not costly, and at the same time need to be decentralized. This implementation neutralizes the difference between on-chain and off-chain transactions.
A typical platform where this is applicable is on the Vertex Market. Being a peer-to-peer platform, the trade volumes that occur on Vertex differ from trade to trade.
The cryptocurrency market is very volatile and prices can change significantly over short periods. With the kind of volumes traded on Vertex, this can come into play when transactions are not instant. However, while we consider these factors, it is also necessary that transactions are decentralized. This will enable the transparency of contracts and the execution process.
Considering the above-mentioned factors, Vertex implements a system that has crucial elements from both transaction systems. This is why it is called a hybrid transaction protocol, combining both on-chain and off-chain transactions.
This system ensures an open and transparent trading environment that is not controlled by any particular individual or group. It takes into account the difference between on-chain and off-chain transactions. At the same time, it ensures that transactions are instant without unnecessary delays.
Frequently Asked Questions (FAQ)
1. What is On-chain Volume?
Volume in the crypto market represents the number of coins traded. When we talk about on-chain volume, we mean the number of valid transactions recorded on the blockchain. If the on-chain volume is high you know that lots of users are trying to execute transactions at once.
2. What is On-chain Transaction?
On-chain transactions refer to transactions that are recorded and verified on the blockchain. On-chain transactions offer security and transparency since they can’t be altered once they’re verified and recorded on the blockchain network.
3. How long do on-chain transactions take?
On-chain transactions take anywhere from 10 minutes to multiple hours for the transactions to get confirmed.
Here we understand that on-chain transactions happen inside the blockchain, unlike the off-chain transaction which happens to be the second variation of the blockchain and occurs outside of the blockchain. Likewise, we know now that some platforms offer both on-chain and off-chain transactions typically known as a hybrid transactions.