  Smart contracts are programs that are executed on the blockchain and can
hold, manage and transfer assets in the form of cryptocurrencies. The
contract's execution is then performed on-chain and is subject to consensus,
i.e. every node on the blockchain network has to run the function calls and
keep track of their side-effects. In most programmable blockchains, such as
Ethereum, the notion of gas is introduced to prevent DoS attacks by malicious
parties who might try to slow down the network by performing heavy
computations. A fixed cost to each atomic operation, and the initiator of a
function call pays the total gas cost as a transaction fee. This helps prevent
DoS attacks, but the resulting fees are extremely high. For example, in 2022,
on Ethereum alone, there has been a total gas usage of 1.77 Million ETH ~ 4.3
Billion USD. This thesis proposes "lazy contracts" as a solution to alleviate
these costs. Our solution moves most of the computation off-chain, ensuring
that each function call incurs only a tiny amount of gas usage, while
preserving enough data on-chain to guarantee an implicit consensus about the
state of the contract variables and ownership of funds. A complete on-chain
execution of the functions will only be triggered in case two parties to the
contract are in disagreement about the current state, which in turn can only
happen if at least one party is dishonest. In such cases, our protocol can
identify the dishonest party and penalize them by having them pay for the
entire gas usage. Hence, no rational party has an incentive to act dishonestly.
Finally, we perform extensive experiments over 160,735 real-world Solidity
contracts that were involved in 9,055,492 transactions in January 2022--January
2023 on Ethereum and show that our approach reduces the overall gas usage by
55.4%, which amounts to an astounding saving of 109.9 Million USD in gas fees.
