Table of Contents
Smart Contracts
DLTs exist on computer systems, so arbitrary accounting rules can be placed into the system and executed when desired. A way to think of this is like spreadsheet macros. You can place a magic cell into the spreadsheet and have some code waiting behind it, the logic of the macro attached to that cell, and the output of entering data into that cell propagates across the spreadsheet (or perhaps across other, related spreadsheets, or even into other systems) according to the rules that have been programmed in the form of that macro.
For this to work, of course, there must be some language defined by the spreadsheet system, and the spreadsheet program must have a way to communicate with a runtime engine that can interpret the commands programmed into the macro.
In a distributed ledger such as Ethereum there is a language called "Solidity" and it can encode commands for the "ethereum virtual machine" (EVM), similarly to macros executing in a spreadsheet.
The Solidity language and the EVM suffer quite a bit from the same kinds of problems that can occur in spreadsheets, such as missing data having an unexpected impact on an outcome or having impossible looking outcomes based on the quirks of the underlying system. In the Gajumaru these problems have been fixed through the introduction of the Sophia language (which can be checked prior to execution and lacks the surprising corner cases that plague Solidity) and the Fast Aeternity Transaction Engine (aka "FATE VM").
The important thing to understand about smart contracts is that instead of entering data into a spreadsheet cell to make the macro machinery execute, a "contract call transaction" must be sent to the blockchain. The leader will take the data in that transaction, put it into whatever function is to be called, and then update the ledger state the same way the spreadsheet program would update the spreadsheet according to a macro's rules. This is an "atomic" action, meaning all changes encoded in the function happen or none of them do.
This idea of macros/smart contracts being able to encode complex actions within the ledger coupled with consensus being focused on all nodes agreeing to the sequence of events (what events happened in what order, and how that affects the ongoing state within the chain's data), all nodes can come to an agreement about what exactly has happened on the chain to date.