?>

Understanding On-Chain and Off-Chain Blockchain Transactions

3.2 k views
Understanding On-Chain and Off-Chain Blockchain Transactions

To ensure thorough comprehension, here are some cryptocurrency terminologies and what they mean as used in this guide:

  • Node (blockchain node): Computers connected to the network that store a full copy of the ledger and process transactions, i.e., miners
  • Wallet: a software or hardware + software container for keeping, sending, and receiving cryptocurrency.
  • Protocol: a set of rules that govern how nodes or computers in a system communicate with one another.
  • Ledger: Decentralized database or record of transactions. Used interchangeably with blockchain

Introduction to Transactions

All events that involve the exchange or transfer of goods, services, money, or value are called transactions. Transferring money between two bank accounts is a bank transaction. Buying a sandwich is a transaction between a buyer and a seller.

Simple transactions are straightforward and occur between two parties, while complex transactions may involve multiple steps and include several intermediaries. Nonetheless, however complex or simple a transaction is, they all follow the same basic principles.

Much of the same rules that govern transactions in the “real world” also apply to blockchain transactions. And to fully understand what on-chain and off-chain transactions are and their differences, you must first understand the basics of transactions and how they work on a blockchain.

The Nature of Transactions

Every transaction is comprised of a few elements. These elements are better viewed as information that must be available for a smooth event. They include:

  1. The parties involved in the transaction
  2. The commodities/goods/currency being exchanged
  3. The medium: Cash, Digital
  4. The amount being transferred
  5. The direction of the transaction: From who to whom

For example, Josh wants a sandwich. He walks up to Carlos (who is at his sandwich shop on the side of the road) and buys a sandwich. Josh gives Carlos $5 and, in return, is handed a delicious sandwich. Josh then walks away while Carlos goes about his business.

In the scenario above, Josh and Carlos are the parties involved. The Sandwich and $5, or a $5 Sandwich, are the commodities being exchanged. The medium is cash. The amount exchanged is $5. The direction of the cash transfer is from Josh to Carlos, i.e., (Josh → Carlos).

Another example: Susie sends $300 to her mom in Denver via a bank transfer. Susie and her mother are the transacting parties, with the bank standing in as a facilitator. Since the transaction is electronic, the medium is digital, the amount is $300, and the direction is Susie →, her mother.

While some transactions have more elements and conditions—for example, Susie’s bank might charge a transaction fee while Carlos won’t charge Josh any transfer fees—they all have the same basic elements.

These transactional elements and rules apply to on-chain and off-chain transactions. However, when it comes to cryptocurrency transactions, another element comes into play.

On-chain Transactions

On-chain transactions are regular transactions made on a blockchain. They can be called native transactions or just “transactions” when discussing a particular blockchain. Native here means they are endemic to a blockchain and are the natural way to make transactions.

A textbook definition is that they are transactions carried out and made available on the blockchain and, as such, are valid only when published/declared on the blockchain.

On-chain transactions are easier to understand when you keep in mind that a blockchain is a distributed public ledger comprised of blocks of completed transactions and nodes that process, check, and publish these transactions to the ledger.

Sending cryptocurrency, like Bitcoin, from one public address to another is an on-chain transaction. The transfer is processed, checked, and cleared by nodes (or miners), and the transaction is published on the blockchain, much like regular financial transactions.

However, as straight forward this may sound, several other processes are going on in the background.

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 needing 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. The transaction is approved if the currency in the sender’s wallet is above the amount they try to send. 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 a 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

Off-chain transactions resulted from the need for fast micro-transactions that were just not possible with on-chain transactions; for example, waiting 10 minutes to pay for a cup of coffee is too slow. Also, transaction fees charged for microtransactions were often higher than the amount being transferred, which is unsustainable.

In response to this, off-chain transactions utilize a layer 2 network on top of the blockchain to transfer value, information, or currency faster between parties. These transactions are not usually published on the blockchain.

A great example of a layer 2 network for off-chain transactions is the Lightning network. The Lightning Network, built on the bitcoin blockchain, allows fast micro-transactions between parties by creating “channels” between nodes. Bitcoin is transferred between parties through these channels at much faster speeds than on-chain transactions.

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 BTC in the multi-sig wallet; the sum of both deposits must be greater than 0 BTC, and this initial deposit is published on the blockchain to ensure transparency.

Both parties’ crypto deposits are 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.

Practical Application

Josh sets up a subscription service on the Lightning network that rents ownership of Crypto Kitties for 0.010 BTC, and Kayla is a Crypto Kitties collector who wishes to subscribe to Josh’s service. If they were nodes, Kayla would deposit 0.5 BTC in the multi-sig address, while Josh would deposit 0 BTC as he is the seller and does not offer refunds.

The sum of deposits on the multi-sig wallet is 0.5 BTC, 0.5 BTC allocated to Kayla, and 0 BTC allocated to Josh.

When Kayla buys one Kittie, 0.010 BTC is deducted from Kayla’s balance and added to Josh’s. Every transaction creates an updated balance sheet that both parties sign with their private keys.

When either party chooses to opt out of the agreement at the end of the transaction, the most recent version of the balance sheet is sent to the blockchain, verified by miners, processed, and published.

According to the final balance sheet’s values, the multi-sig address funds are then disbursed to the parties.

This removes the need for processing every micro-transaction on the blockchain, thereby radically enhancing speed, scalability, and efficiency. It also reduces the transaction load that nodes must process and helps mitigate the ledger’s growing size.

However, off-chain transactions do not automatically inherit the blockchain’s immutability, and steps must be taken to ensure the transactions’ authenticity.

On-Chain Vs. Off-Chain

Comparing on-chain and off-chain transactions is not a question of “either-or,” nor is it about one being superior. Instead, both methods of resolving transactions work in tandem to make blockchain networks faster, more efficient, and suitable for enterprise use.

Without on-chain transactions, off-chain networks would be detached from the blockchain, defeating the whole purpose of having a blockchain. And without off-chain transactions, blockchain networks like bitcoin would be too slow and inefficient to cause any real disruption.

Bitcoin coin symbol
Btc
Bitcoin
$62.547
price
red chart
decrease symbol0.84959%
price change
TRADE NOW

At the heart of it all, an On-chain Vs. An off-chain guide explains how both transactions work and then shows how they work together.

Previous

Founder of Bitcoin Mixer Penalized $60 Million by FinCEN

Next

A Beginner Guide on How Bitcoin Transactions Work

Written by

312 posts

Bogdan is a genuine outside-the-box thinker. His philosophy is never to settle and always evolve. Since the very first moment, he heard of Bitcoin, he knew it would revolutionize the world.

VIEW AUTHOR

More author posts

How High Will Solana Go in the Next Bull Run?

Solana (SOL), a blockchain designed for decentralized applications (dApps) and crypto-currencies, has garnered immense attention from investors. As we approach the possibility of a new bull run, one of the most frequently asked questions is: How high will Solana go? Understanding Solana’s Strengths Solana's architecture, which combines proof-of-stake (PoS) and proof-of-history (PoH), makes it one of the market's fastest and most scalable blockchains today. This high transaction throughput has earned Solana the reputation of being an “Ethereum killer,” competing with…

The Rise of New Online Crypto Casinos And What to Expect in 2024

Over the years, the online gambling industry has evolved many times, adapting to new technologies and meeting the demands of players worldwide. One of the biggest transformations in recent times has been the use of cryptocurrency in the online gaming sector. As digital currencies become mainstream, a new type of online casino is emerging—crypto casinos that accept cryptocurrencies as their primary mode of transaction. The rise of new online crypto casinos in 2024 is fueled by several key factors, including…

Discover Top Tron Casinos in 2024

Cryptocurrency casinos are becoming increasingly popular. Among the digital currencies, Tron (TRX) has become a favorite for many online gamblers, offering speed, security, and low transaction fees. In 2024, many platforms are using this innovative technology making TRON casinos more exciting than ever. [caption id="attachment_365516" align="aligncenter" width="750"] https://www.pexels.com/photo/bitcoins-beside-a-phone-6771664/[/caption] How Exactly Do TRX Casinos Work? TRX casinos operate on blockchain, allowing players to deposit, wager, and withdraw using TRX cryptocurrency. TRX casinos function similarly to traditional online casinos, but they use…

A Complete How-To for Safe Ethereum Casino Gambling in 2024

For those who are unfamiliar with the idea, navigating the world of Ethereum casino gaming may be both thrilling and intimidating. Ethereum has gained appeal as a cryptocurrency due to its ability to provide gamers with a more secure and decentralized online gaming experience. But there are a lot of hazards and factors to take in mind, and the terrain can be complicated. This article is intended to assist you in entering Ethereum casinos securely and confidently. It offers you…

Singaporean Blockchain Wallet Security Company Discovers New Type of Scam Targeting Centralized Exchanges

Fraudulent Transactions Exploit Wallet Vulnerability, Could Have Stolen More than $3 Million in TRX   CoinsDo, a Singaporean blockchain asset security company, has uncovered a sophisticated scam involving fake transactions and multiple smart contracts targeting major centralized cryptocurrency exchanges. While only a single successful instance of this scam has been confirmed, further analysis of the smart contracts in question revealed that the perpetrators initiated hundreds of these fake transactions, potentially defrauding exchanges, payment gateways, and centralized wallet companies of more…

Top 5 Cryptocurrency Exchanges to Use This Bull Run

Cryptocurrency exchanges are the junction points for the entire crypto industry. These digital platforms provide the main tools for buying, selling, or trading crypto assets. Millions of people use them daily, and their numbers skyrocket during a bull run like the one we're experiencing now. Despite the industry’s vast offering of over 300 crypto exchanges, we can’t even name two that offer an identical trading experience. Every platform has different liquidity volumes, safety standards, trading options, or tools. They also…

Publish your own article

Guest post article. Guaranteed publishing with just a few clicks

START PUBLISHING ADVERTISE WITH US

Browse categories

Explore trending topics in the crypto community right now.

Bitcoin

SEC Greenlights Multiple Bitcoin ETFs, Signaling Major Leap for Cryptocurrency Markets

The U.S. Securities and Exchange Commission (SEC) has made a landmark decision by approving 11 spot bitcoin exchange-traded funds (ETFs). This move represents a significant moment in the cryptocurrency industry, marking a shift towards greater institutional adoption and accessibility for investors. The approved ETFs include products from major firms such as BlackRock’s iShares Bitcoin Trust, Grayscale Bitcoin Trust, ARK 21Shares Bitcoin ETF, Bitwise Bitcoin ETP Trust, WisdomTree Bitcoin Fund, Fidelity Wise Origin Bitcoin Trust, VanEck Bitcoin Trust, Invesco Galaxy Bitcoin…

Bitcoin Should be Banned in the United States: Charlie Munger

Berkshire Hathaway’s vice chairman, Charlie Munger, called for a ban on cryptocurrency in the United States on Monday, similar to the one in China.  In an op-ed published with the Wall Street Journal, Munger argued that Bitcoin isn’t a currency, commodity, or security, but simply a form of gambling “ with a nearly 100% edge for the house. As such, the enactment of a federal law should ban such things from happening. Munger cited the Chinese communist party’s ban on…

Tesla’s BTC Positions Remained Unchanged in Q4 of 2022

According to a new earning report from automotive manufacturer Tesla, the company did not sell any of its BTC holdings in the fourth quarter of 2022. Amid speculations that the company had traded BTC during the testing bears, CEO Elon Musk revealed it was yet holding on to its BTC stash. Tesla Maintains Holdings After Initial Sell-Off In Q2 of 2022, Tesla opted to sell 75% of all its BTC. The car manufacturer received close to $950M in exchange. Notably,…

Here’s When Grayscale Debates the SEC in Court on its Bitcoin Spot ETF

The District of Columbia Court of Appeals has marked a date for when Grayscale and the Securities and Exchange Commission (SEC) may present oral arguments regarding the approval of a Bitcoin spot ETF.  Each side will present its case at 9:30 am ET on March 7, with the SEC arguing against the product, and Grayscale arguing in favor.  Grayscale VS SEC The court date – revealed in a court order filed on Monday according to CNBC – is much earlier…

MORE ARTICLES

Ethereum

Ethereum’s Zhejiang Staking Withdrawal Testnet for Shanghai is Live

At 15:00 UTC on Wednesday, the much-anticipated Zhejiang testnet for staking withdrawal went live on Ethereum’s Beacon chain. Zhejiang will enable the testing of the Ethereum Improvement Proposal (EIP) 4895 which allows for staking withdrawals. This is in preparation for the network’s next major update, the Shanghai hard fork slated to launch sometime in March. Users Can Make Simulated Withdrawals with Zhejiang In a tweet yesterday, DevOps engineer at Ethereum foundation Barnabas Busa gave details about the Zhejiang testnet slated…

Ethereum Devs Disagree Over Technical Tweak as Shanghai Upgrade Nears

Post-merge Ethereum users have been eagerly awaiting the commencement of the network’s next major upgrade, Shanghai. However, after over 3 months of prep time, it appears the Shanghai rollout isn’t going as smoothly as expected. What Exactly is the Shanghai Upgrade? In September last year, the much-publicized Ethereum Merge also known as the Ethereum 2.0 upgrade went live. Ethereum underwent some significant changes as its consensus mechanism transitioned from proof-of-work to a cost-efficient proof-of-stake system.  However, since the Beacon launch…

FTX Hacker Converts 50k Stolen ETH to BTC

Per a report from blockchain analysis firm Chainalysis, the attacker behind the Nov 11 FTX exploit, is converting the stolen ETH to Bitcoin. There were muted fears the seemingly inexperienced perpetrator could dump all its ETH holdings. On Sunday, the attacker dumped 50k ETH on-chain, with ETH's price dipping by almost 7%.  https://twitter.com/chainalysis/status/1594349583416840199?s=20&t=pgvQHeVytI20eKQ1ls9bxw Hacker Moves 50,000 ETH to New Address Over the past week, the perpetrator had been steadily swapping the cryptocurrencies they had carted off for Ether tokens. This…

Censorship Concerns: 51% of Ethereum Blocks Now OFAC Compliant

According to new data, over half of the blocks on the Ethereum network now reportedly comply with the US Treasury OFAC’s standards. This comes roughly a month after the platform’s monumental merge update. Phasing Out Tornado Cash The Office of Foreign Assets Control is the intelligence and enforcement agency of the US  Treasury Department. Indeed, the OFAC administers and enforces US  financial sanctions. A prime example of this is the recent, highly-publicized ban on crypto mixer Tornado Cash.  According to…

MORE ARTICLES

Trading

How to Leverage Arbitrage Opportunities in Crypto Markets

Cryptocurrency arbitrage has become an increasingly popular investment strategy as the crypto market grows and evolves. Arbitrage involves taking advantage of pricing discrepancies between markets or exchanges to profit.  Investors can leverage profit opportunities by understanding cryptocurrency arbitrage while managing associated risks. In this guide, we'll explore cryptocurrency arbitrage and how it works. A Bitcoin-related example will help us illustrate the concepts of this strategy. What is Arbitrage and How Does it Work in Crypto Markets Crypto arbitrage trading is…

The Different Types of Copy Trading in Crypto

Are you interested in trading cryptocurrencies but feel intimidated by the complexity of the process? Copy trading is a great way to get into crypto without needing to be an experienced trader. With copy trading, investors can benefit from the experience and knowledge of more experienced traders, allowing even beginners to succeed. How does copy trading work, and which tips do you need to know to succeed? In this article, we'll explore all aspects of copy trading in crypto. What…

How to Spot an Unsafe Crypto Exchange

Cryptocurrency exchanges have become increasingly popular as they provide a platform for people to buy and sell digital assets. Unfortunately, not all crypto exchanges are safe or reliable.  With the rise of cybercrime and fraud, you must learn to spot an unsafe crypto exchange before investing your money. This guide will help beginners identify and avoid potential risks when selecting a cryptocurrency exchange.  The Role of Crypto Exchanges on the Digital Assets Market Cryptocurrency exchanges play a crucial role in…

What Is Grid Trading in Crypto?

Crypto grid trading has become a popular strategy because of its ability to help traders capitalize on market volatility. Grid trading means you can produce consistent profits by taking advantage of price differences in different markets or time frames. By establishing buy and sell orders at predetermined intervals, you can take advantage of these fluctuations in an automated way. This guide will explore the different aspects of grid trading and provide an overview of its benefits, challenges, and more. Through…

MORE ARTICLES

Tech

Introducing una Messenger: A Paradigm Shift in Blockchain Connectivity

The digital landscape is set for an unprecedented transformation with the introduction of una Messenger, the latest innovation from web3 development powerhouse Wemade. This platform represents an evolution of the "PAPYRUS Messenger," serving as the cornerstone of the ambitious "unagi" initiative, aimed at catalyzing the mass adoption of blockchain technology. The "Unbound Networking & Accelerating Growth Initiative" seeks to bridge the divides between diverse blockchain services and networks, heralding a new era of interconnectedness. A New Frontier in Blockchain Communication…

Bit2Me Champions WEMIX Token in Pioneering European Listing

Bit2Me, Spain's premier virtual asset exchange, has recently broadened the horizons for cryptocurrency enthusiasts by listing WEMIX, the cornerstone token of the WEMIX3.0 blockchain ecosystem. This marks a notable achievement as WEMIX's inaugural venture into the European market, emphasizing the token's role in facilitating a range of blockchain-based activities, from gaming transactions to decentralized finance (DeFi) applications. Launched with the intention to democratize access to WEMIX for the 450 million Spanish speakers around the globe, this strategic move aligns with…

CryptoVirally Expands with Fresh Crypto Marketing Offers and Cointelegraph Upgrades

In an exciting update for the cryptocurrency marketing landscape, CryptoVirally has announced a series of new entries and enhancements to its already comprehensive range of services. These updates, aimed at providing tailored marketing solutions for crypto projects, include new limited-time offers and expanded options for Cointelegraph publications. Limited Offers: A Game-Changer in Crypto Marketing  CryptoVirally's limited offers section presents an enticing opportunity for crypto projects to leverage high-impact marketing services at discounted rates. These offers, available for a limited period,…

Breaking Boundaries in Blockchain: WEMIX’s ‘una Wallet’ Sets New Standard for Multi-Chain Asset Management

The WEMIX Foundation has unveiled 'una Wallet,' a revolutionary digital wallet designed to offer unparalleled convenience and security in managing digital assets across various blockchain networks. The announcement, made on January 17, 2024, signifies a new era in the seamless integration of multiple blockchain protocols, including Arbitrum, Avalanche, BNB Smart Chain, Ethereum, Kroma, Optimism, Polygon, and WEMIX3.0. 'una Wallet' is more than just a digital wallet; it represents the culmination of WEMIX's innovative efforts in the blockchain space. It serves…

MORE ARTICLES