Key Takeaways
Cryptocurrency transactions are recorded on a public ledger, with on-chain transactions occurring directly on the blockchain.
When parties transfer digital currencies like Bitcoin (BTC) and Ethereum (ETH) from one address to another, this process is permanently and transparently recorded on the blockchain. On-chain transactions uphold blockchain integrity and security.
Off-chain transactions refer to cryptocurrency movements that occur outside the blockchain network.
Transactions that are not recorded on the blockchain are typically made at a faster transaction speed and incur lower fees than on-chain transactions but rely on trusted intermediaries. Off-chain transactions offer efficiency and scalability that play an essential role in cryptocurrency.
Off-chain transactions are different from on-chain transactions about decentralization. On-chain transactions are recorded on a decentralized blockchain and maintained by numerous computers, allowing open access and verification of miners.
In contrast, off-chain transactions outside the blockchain framework often involve centralized entities like banks or payment processors for management. Consequently, off-chain transactions lack the same level of decentralization as on-chain transactions and necessitate greater trust in the managing entities.
A “funding transaction” in a payment channel is an on-chain transaction where parties commit a certain amount of cryptocurrency into a multisignature wallet. The committed amount is recorded on the blockchain and is the initial deposit that opens the payment channel.
The funds in the multisignature wallet can only be spent with the agreement of both parties involved in the channel, which ensures that the off-chain transactions can be settled on the blockchain when the channel is closed.
On-chain transactions work as follows:
A sender starts the process by sending a payment instruction. An instruction typically specifies the amount of cryptocurrency to be transferred to the receiver.
The payment instruction is formulated into a transaction, including essential details, such as the source and public addresses, the amount to be transferred, and a transaction fee.
The sender uses the private key to digitally sign the transaction. The signature verifies the sender’s identity and authorizes the transaction. This ensures that only the rightful owner of the funds can initiate the transfer.
Proof-of-stake (PoS) nodes on the network validate the transaction. Validation is done by checking the digital signature for authenticity and ensuring the sender has sufficient funds to complete the transaction.
Proof-of-work (PoW) blockchains like Bitcoin confirm the transaction using miners. Said miners gather multiple transactions to form a new block every ten minutes on average. Expanding computational power and energy in the process of confirming the transaction.
Once a miner solves the puzzle, the new transaction block is added to the blockchain. This process is known as mining a block.
The transaction is considered confirmed once it’s included in a block on the blockchain. Additional confirmations occur as more blocks are added to the block containing the transaction, further securing its record.
The funds are transferred to the recipient’s address, and the transaction is now permanently recorded on the blockchain. Both parties can verify the transaction using blockchain explorers.
Off-chain transactions occur outside the blockchain network, so all off-chain transactions are processed without blockchain confirmation. Below is a simplified explanation of how this is possible:
Two parties create a payment channel and make a “funding transaction” on the blockchain. Where a transaction is recorded on-chain, but subsequent transactions between them occur off-chain.
Parties will exchange digital “IOUs” or transaction information off-chain. Parties can do this numerous times with each other without involving the blockchain for each transaction.
After multiple transactions, the final balance is calculated between the two parties.
Once the parties decide to close the channel, a final transaction on the blockchain reflects the net outcome of all off-chain transactions. This final on-chain transaction settles and secures the net balance.
Some advantages that are gained by transacting directly on the blockchain include:
Some drawbacks associated with making transactions on the blockchain include:
Some advantages of off-chain transactions include:
Some of the drawbacks associated with off-chain transactions include:
Technologies like the Lightning Network for Bitcoin or the Raiden Network for Ethereum allow transactions off-chain with the final settlement programmed on the blockchain.
These are separate blockchains connected to the main blockchain via a two-way peg, allowing assets to be securely used within the sidechain without affecting the main chain.
Payment channels supporting off-chain state updates, such as smart contracts, can interact with on-chain code.
Services like centralized cryptocurrency exchanges often conduct transactions off-chain where users trade balances within the exchange’s internal systems, and only deposits or withdrawals are recorded on-chain.
Networks that sit on top of the blockchain to enable faster and more cost-efficient transactions. Examples include Optimistic and Zero-Knowledge Rollups.
On-chain transactions are the primary use case behind blockchain technology built on trust and security, providing a transparent, immutable ledger of transactions that uphold the decentralized narrative of cryptocurrency.
On the other hand, off-chain transactions offer speed, efficiency, and privacy at the cost of relying on intermediary trust and potentially compromising the decentralized advantage.
Both methods have unique benefits and drawbacks that should be considered before engaging in both on and off-chain transactions. The Lightning Network is one prominent example of off-chain technology that addresses the limitations of the blockchain’s scalability while striving to retain Bitcoin core principles.
What are on-chain transactions?
On-chain transactions are cryptocurrency transfers between parties, recorded and verified on a blockchain, offering a transparent and immutable transaction ledger.
How do off-chain transactions operate?
Off-chain transactions happen outside the blockchain, offering faster and cheaper transfers, typically involving third-party intermediaries for processing.
Why choose on-chain over off-chain transactions?
On-chain transactions are chosen for security and decentralized verification, while off-chain transactions are preferred for speed and lower fees.
What technology enables off-chain transactions?
Technologies like the Lightning Network enable off-chain transactions, allowing for scalable and efficient cryptocurrency payments.