What is an Ethereum-based smart contract?
Supported by the Ethereum Virtual Machine, a ‘smart contract’ is basically a computer program that runs on the blockchain. It combines two important elements: code (its functions) and data (its state). A smart contract is also a type of Ethereum account—and can send transactions through the network. Such programs live at a specific address on the blockchain and cannot be changed. The term describing this inability to be altered is ‘immutable.’ Once deployed to the network, it cannot be controlled by a user. Therefore, they must run as programmed. User accounts can then interact with a smart contract.
When do rules influence a smart contract?
How? By submitting transactions that execute a function defined via the smart contract. Like a regular contract, these define rules. Those rules are automatically enforced using the code. Importantly, smart contracts cannot be deleted by default and interactions with them are irreversible. In this context, the word “contract” has no legal meaning. Technically, they aren’t “smart” either. The term was coined in the 1990s by cryptographer, Nick Szabo. His original description is: a set of promises, specified in digital form, including protocols within which the parties perform on the other promises. Here, it is different.
Which are a smart contract's main functions?
The result of a contract’s execution is the same for everyone who runs it. Two factors determine this: (a) the transaction’s context that offset execution and (b) state of blockchain at the point of execution. A contract is identified by an Ethereum address. A function of the originating account and nonce, it is generated via a contract creation transaction. It can be used as a transaction recipient. A transaction could mean sending funds to the contract or calling a function on it. Contracts run if called by a transaction.
Why is the Ethereum Virtual Machine significant?
The Ethereum Virtual Machine (EVM) behaves as a single entity maintained by thousands of connected computers. Its existence equals a network of nodes. Where it remains on the decentralized web, it is not so much physical as it is digital. Its protocol works to conserve its special state of being continuous, uninterrupted, and immutable. Its environment is where Ethereum accounts and smart contracts live. True to its form, the EVM is what defines the rules for computing a new valid state from block to block.
How does the creation of smart contracts work?
Ethereum contracts are executed by a transaction initiated from an Externally Owned Address (EOA). As mentioned before, smart contracts are basically computer programs. These programs are produced or written using code. The code applied is typically a high-level language that works to assign functions. These functions determine what happens with a transaction. With Ethereum contracts, Solidity is one example of the coding languages used. To run, a smart contract is compiled per the low-level bytecode that runs in the EVM. Once done, they are deployed by way of a special contract creation transaction. Then, identification happens when the transaction is sent to the special contract creation address: 0x0.
Who can create a smart contract via Ethereum?
At the time of writing, Ethereum uses a consensus protocol called "proof-of-work". This allows the network to agree on the state of information recorded on the chain, like account balances and the order of transactions. This prevents users from "double spending" their coins. It also ensures that the chain is tremendously difficult to attack or manipulate. Ethereum will switch to the “proof-of-stake” protocol in 2022.
Where to go on Etherscan to view contracts?
Etherscan is the leading block explorer for Ethereum. A smart contract is displayed on Etherscan as an address. To view one, a user simply needs to enter the address into the search tab on Etherscan.