Starting with Ethereum1, almost all blockchains provide a Turing-complete computation environment to execute programs (so-called smart contracts2, but in Solana they are called just programs) on chain. The execution is usually handled by some VM (the most popular choice is WASM-compatible VMs3) which is builtin in the node. The smart-contracts are written either in domain languages like Solidity and Cairo or in general languages like Rust (to be compiled to wasm or other ISA)4.

Because of the whole domain complexity and available sources of contracts, any overlooked bug can bring a disaster5

If create such smart-contracts which allow some (based for example on the entrance fee) accounts in the blockchain to vote on some proposals, we will get a collective decision making, or so-called DAO (Decentralized Autonomous Organization)6. DAOs are real7.

1

Bitcoin also has Bitcoin Script but it doesn’t provide loops as a control structure.

2

The concept of smart contract was proposed by Nick Szabo in 1994

3

besides WASM-compatible VMs (like Wasmer), there is a Sealevel - Solana EBPf compatible VM with parallel execution, zkVM, Risc0 to name a few

4

Check https://defillama.com/languages to see the most popular languages. But also take into account the target chain and estimate computation costs (aka “gas fees”) as an execution of a smart contract is not free.

6

Despite evident pros (decentralized, automatic process) and cons (e.g. bugs in the smart contracts, longer decision process), in case of DAO governance with fungible tokens there is a problem of “whales” - large token holders which can shift voting or in case of DAO governance with the whitelisted accounts the risk of Sybill attack. They can even use so called flash loans(when tokens are borrowed and returned within one block so no collateral is required) to gain a voting power in momentum.

7

A US state of Wyoming even recognizes DAOs as LLC to provide them a full legal status. See also Securities Law: Social & Community Tokens