On-chain vs Off-chain

We often refer to a dichotomy of ‘on-chain’ vs ‘off-chain’, to refer to different sites of interaction that development of dApp systems must interact with.

For instance, many codebases are split into ‘onchain’ & ‘offchain’ subcomponents.

On-chain

When we say something is ‘on-chain’, what we mean is that it primarily exists within, or relates to validation of transactions on the Cardano ledger.

For a dApp developer, usually this really means that it concerns the construction of Plutus scripts, which are run by Cardano validator nodes to validate certain transactions.

Examples of things that can be considered ‘on-chain’:

Off-chain

When we say something is ‘off-chain’, we mean that it concerns the interaction between the Cardano blockchain and ‘the outside world’.

For example, dApp systems often have ‘offchain’ subcomponents, which involve interacting with the cardano blockchain to produce the functionality of the dApp by constructing Transactions which follow the rules of the on-chain components.

If something happens ‘off-chain’, this can mean that there is a process external to the on-chain validation which implements the associated functionality. Sometimes this can mean that parts of the dApp logic are handled by different means than the validation of Plutus scripts - such as Oracles.

Examples of things that can be considered ‘off-chain’: