ON-Chain Or OFF-Chain

What's the difference and why it matters.

Andrey Didovskiy
The Capital
Published in
4 min readJun 20, 2019

--

Whenever inspecting the architecture of Distributed Technology, such as Bitcoin and Ethereum, the activity of the network can be generalized into two groups:

  1. ON-chain
  2. OFF-chain

The terms are used to clarify where some sort of computation was conducted before being published & updating the Network.

Understanding the difference in computational methodology is essential to understanding the architecture of any Crypto / Blockchain project.

ON-chain refers to all activity that is processed by the network.
OFF-chain refers to all activity that is processed outside of the network.

ON-Chain

Processing data ON-chain means that a portion of the network’s computational resources must be allocated towards that data. As more and transactions are pushed ON-chain, the network slows down and becomes more expensive to use.

Just think about Bitcoin; Bitcoin is designed in such a way that, any and all interaction with its blockchain is processed by the network. Let's take a peek under the hood:

Alice decides to send Bob some Bitcoin. Alice will output a transaction to the BTC network in the form of a data packet that consists of certain parameters. Those parameters being:

- Address sending from
- Address sending to
- Amount being sent
- Hash reference to previous transactions
- Signature

These parameters must then undergo the computational process of encryption, decryption, and ultimately Validation. Again, due to the design of Bitcoin, that computational process is conducted by the network.

Loose High level Anatomy of a BTC tx.

This certainly results in a much more trustless system, a system in which the need to trust others is minimized while still “guaranteeing” informational accuracy and security. Given the computational effort needed to sustain such a mechanism, it is, unfortunately, very expensive and limited in scalability.

This is where OFF-chain computation comes in.

OFF-Chain

Created out of the need to scale, OFF-chain computation is exactly what it sounds like; offloading the computational demands somewhere and then just publishing the results, or proofs, ON-chain.

Say we need 16 bytes of data to perform a computation and only 2 bytes to push an update to its new state. Say that a blocks maximum byte throughput on the network was 512 bytes, that would mean we can publish 256 updates or perform 32 computations (which would still then cost 64 bytes to push).

Put side by side,
Updating the state machine 1000 times will cost 2000 bytes broken up into 4 blocks worth of time.
while
Computing AND updating on the state machine those same 1,000 times will cost 16,000 bytes + 2,000 bytes broken down into 36 Blocks worth of time.

2,000 On-Chain transactions = 36 Blocks of time
2,000 Off-Chain transactions = 4 blocks of time

Essentially we are making the network’s throughput 9x better.

This is made possible by forcing participating nodes to compute data that is only relevant to themselves, as opposed to, having validated their unrelated networks members transactions as well. These independent chains are then organized and checked against the total system by the system.

OFF-chain processing can happen in a few different locations such as a TEE [Trusted Execution Environment] or at the local hardware device of the account (computer), or even some other distributed structures or systems that lay over the main chain and create more robust 2nd layer structures. Such as the 0x and Lightning Network projects.

In distributed systems:

All computation leads On-Chain.

So instead of trying to figure out which is superior, ON-chain or OFF-chain, let's understand that all OFF-chain computation will at some point, in some way, shape or form become On-Chain data.

OFF-chain activity is done in the name of Scalability and Usability.

ON-chain Activity is done in the name of Security and Immutability.

Both concepts have an important role to play when it comes to creating the future digital economy; telling them apart helps mold a more concrete understanding of where we are headed and how it's going to look when we get there.

👏 Please leave a few claps for our Digital future 👏

P.S. If you think that one is better then the other, I politely ask you to make your statement in the comments below for some discussion

--

--

Andrey Didovskiy
The Capital

💎 Digital Asset Investor 🧙‍♂️ Crypto Content Wizard | Solving Problems through communication. 🌟 https://linktr.ee/andreydidovskiy