MatchingCode
Now that we have seen a snippet of how to make transactions in Cardano, we can go ahead and create our first smart contract using Aiken as the on-chain code and Lucid as the off-chain code. Our smart contract will lock funds in the contract, we will have a beneficiary to unlock the funds, and we will have a redeemer to unlock the funds.
What is On-chain and off-chain code.
On-chain code: This refers to the code that is executed directly on the blockchain. Allows developers to define the logic of their smart contracts directly on the blockchain, enabling secure and trustless execution.
Off-chain code: Off-chain code, on the other hand, runs outside the blockchain. It is often used for tasks such as interacting with users through graphical interfaces, querying data from external sources, and performing computations that do not need to be verified on the blockchain itself.