A smart contract is a computer program or a transaction protocol respectively, which is intended to automatically execute, control or document respectively legally relevant events and actions according to the terms of a contract, of an agreement or of a negotiation. The objectives of smart contracts are the reduction of need in trusted intermediators, arbitrations and enforcement costs, fraud losses, as well as the reduction of malicious and accidental exceptions.
Vending machine is mentioned as the oldest piece of technology equivalent to smart contract implementation. 2014's white paper about cryptocurrency Ethereum mentions Bitcoin protocol to be a weak version of the concept of smart contracts as defined by Nick Szabo. Since Ethereum, various cryptocurrencies support scripting languages for more advanced smart contracts between untrusted parties. In the cryptocurrency space, smart contracts are digitally signed in the same way a cryptocurrency transaction is signed. The signing keys are held in a cryptocurrency wallet.