The limits of Smart Contracts…
…only capable of being basic on-chain/off-chain hybrid prototypes. It cannot trigger transactions in later blocks without requiring off-chain triggers… we explore why this is, and is there a solution?
The EVM (Ethereum Virtual Machine) and similar blockchain-based smart contract environments exhibit certain limitations, particularly regarding how operations are initiated and how extensive the on-chain functionality can be.
One main limitation is the inability to natively trigger new transactions directly from smart contracts based on on-chain events without external intervention.
Let’s have a quick look at why smart contracts cannot trigger other transactions without needing off-chain events, and explore what else is possible, to supercharge your ability to build real-world production ready web3 applications.
Limits of Smart Contracts and the EVM
- Transaction Initiation Must Be External:
- In current EVM environments, all transactions must be initiated by external accounts (Externally Owned Accounts — EOAs) rather than by smart contracts themselves.
- Smart contracts cannot autonomously broadcast new transactions; they can only perform operations in response to transactions they receive.
2. Reactive, Not Proactive:
Smart contracts are reactive rather than proactive. They operate when invoked by a transaction and cannot schedule or initiate future transactions or calls independently based on internal conditions or state changes.
3. State and Event Handling:
While smart contracts can emit events that reflect changes in state or significant occurrences during their execution, these events do not trigger on-chain reactions directly. Instead, they are intended for the off-chain world — allowing dApp interfaces, monitoring tools, or backend servers to react to these events.
4. Gas and Computation Constraints:
Each transaction in a blockchain environment like Ethereum is limited by gas constraints, which cap the amount of computational work a transaction can perform. This limitation ensures network performance and security but also restricts the complexity and scope of what smart contracts can achieve in a single transaction.
Key points:
- Indirect Triggering: The original smart contract does not directly call another smart contract in a new transaction within the blockchain. Instead, it relies on off-chain triggers to initiate new transactions.
- Different Blocks: Because the new transaction must be independently submitted and mined, it typically occurs in a different block than the initial transaction.
Solution… “Enhanced On-Chain Functionality”
Substrate is one solution that enables enhanced on-chain functionality, and it is useful if you want to build something production ready which is more than just a hybrid on-chain/off-chain prototype mentioned above.
Substrate is a blockchain framework designed for creating custom blockchains.
On-Chain Logic and Automation
Substrate allows for the creation of more sophisticated on-chain logic through its modular framework. By using runtime modules (pallets), developers can design systems where certain on-chain events can indeed trigger further on-chain actions directly, something not natively possible with EVM-based systems.
Richer State and Event Management
With Substrate, it’s possible to implement more complex state transitions and control flows that can include scheduling future on-chain actions based on events. This is facilitated by allowing pallets to interact more freely and trigger each other within the blockchain’s operation rules.
Customizable Computation and Gas Metrics
Substrate-based chains can define their own computation and gas metrics, potentially allowing for more generous limits compared to the EVM. This flexibility can support more extensive on-chain operations without requiring off-chain triggers.
Native Cross-Contract Calls
Substrate enables more seamless interactions between contracts or pallets. These can be designed to react to internal blockchain events with new transactions or operations, enhancing automation and reducing reliance on external triggers.
Conclusion
The limitations of EVM-based systems inherently restricts autonomous on-chain activities. Platforms like Substrate offer a different approach, where more expansive on-chain functionality is possible, allowing blockchains to support complex operations and autonomous interactions that go beyond what traditional smart contracts can do in EVM environments, allowing you to build more production ready use-cases.