<p>Yes, that's correct. On-chain is exactly what it says. It's logic that happens on every validator syncing the chain. The unique thing with plutus is the on-chain and off-chain code can live together and share e the same types/imports.</p>

CC BY-SA 4.0
2022-01-17T01:40:36.833Z
2022-01-17T01:40:36.833Z
Samuel Leathers
<p>I've seen the existing similar questions on this topic. I probably still don't get it. So a question:
Is it a correct analogy to the JS-Solidity world that</p>
<ul>
<li>the On-chain code corresponds to the SmartContract code I write in Solidity (and lives and executes on each node), while,</li>
<li>the Off-chain code corresponds to the JS client code that shows the UI, prepares and invokes the transaction calls made into the blockchain, and executed by the Smart Contract?</li>
</ul>

<plutus><on-chain>
On-chain and Off-chain code
# On-chain and Off-chain code

(Asked by: username_0 on 2022-01-17)

I've seen the existing similar questions on this topic. I probably still don't get it. So a question:
Is it a correct analogy to the JS-Solidity world that

* the On-chain code corresponds to the SmartContract code I write in Solidity (and lives and executes on each node), while,
* the Off-chain code corresponds to the JS client code that shows the UI, prepares and invokes the transaction calls made into the blockchain, and executed by the Smart Contract?

**Tags:** plutus, on-chain

---

## 1 answers

### Answer by username_1 on 2022-01-17. Score: 3

Yes, that's correct. On-chain is exactly what it says. It's logic that happens on every validator syncing the chain. The unique thing with plutus is the on-chain and off-chain code can live together and share e the same types/imports.


---

