user5390: 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?


user382: 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.

5390: <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>
 382: <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>
