Blog

Thu, 08 Dec 2022 08:50:24 GMT by Silver / Toolblox
Originally published in Medium.

While studying blockchain and smart-contract development one will eventually run into the term ‘self-executing’. Statements might be similar to these:

  • “Smart contracts are self-executing computer programs that live on a blockchain” ¹
  • “smart contracts are used to automate the implementation of agreements for parties to achieve near-instant finality without the involvement of a third party.” ¹
  • The code is run and executed by all computers in the network. If a term of the contract is satisfied and it is verified by all participants of the blockchain network, then the relevant transaction is executed. ²
  • etc.

The problem with all these statements in the context of a computer program is that one might infer that a smart-contract runs automatically, by itself. Not only is this NOT the case but self-execution refers to something far more important than automation.

History of the term ‘self-executing’

The term ‘self-execution’ comes from law, specifically referring to self-executing treaties. A self-executing treaty is an agreement between parties which upon signing, immediately becomes enforceable by the law and the judiciary system. A non-self-executing treaty on the other hand needs additional legislation to become enforceable.

“At a general level, a self-executing treaty may be defined as a treaty that may be enforced in the courts without prior legislation by Congress, and a non-self-executing treaty, conversely, as a treaty that may not be enforced in the courts without prior legislative ‘implementation.’” ³

The term in its original context has no relation to computers, programming or software automation. It is merely the act of signing a document which then can immediately be held up in the court of law. Furthermore, checking the dictionary for ‘execution’ we can see these two distinct meanings ⁴:

Execution
noun

  1. (computer science) the process of carrying out an instruction by a computer.
  2. (law) the completion of a legal instrument (such as a contract or deed) by signing it so that it becomes legally binding and enforceable.

‘Self-executing’ smart contracts

Back to smart contracts. Smart contracts are essentially computer programs — procedures — deployed to and executed (run) by the blockchain network. When a computer program is deployed on a blockchain it gains unique qualities which make it possible to trust the program without further inputs, checks or external validation. This means that the program could be used to represent a contract between counterparties — what we get is a self-executing contract.

The use of a blockchain is important for several reasons when it comes to self-executing smart contracts. First, a blockchain provides a decentralized and immutable ledger that allows the terms of a contract to be recorded and enforced without the need for a central authority or intermediary. This ensures that the computer program and its encoded rules are secure and transparent, and that it cannot be altered or tampered with once it has been deployed.

Second, a blockchain provides a way for the agreement to be executed (go into effect) automatically, without the need for any further input or intervention from the parties involved. This allows the contract to enforce its terms in a trustless manner, ensuring that the terms of the agreement are followed without the need for trust between the parties.

Overall, the use of a blockchain provides the necessary storage, access rights, and trustless execution environment that is required for a contract to be considered self-executing.

Real world examples of self-executing smart contracts

Here are few examples of self-executing clauses in a digital agreement:

  1. A smart contract that automatically releases funds to a seller when a buyer receives a product. The trigger may be the buyer’s confirmation that they have received the product.
  2. A smart contract that automatically distributes profits to investors in a crowdsourced project according to their agreed-upon ownership stakes. The trigger may be the completion of the crowdsourced project
  3. A smart contract that notifies about a security upgrade on a network of connected devices when a vulnerability is detected. The trigger may be the submission of a patch for a security vulnerability.

More examples of self-executing smart contracts can be found at www.toolblox.net.

Smart contract automation

What about running smart contracts automatically — making them execute on their own? For example, if in the contract there is a clause that an agreement or promise expires at a certain point of time or some other kind of external event should dictate a state transition in the contract… There is no built-in functionality in blockchains to achieve any of that but there are several approaches to handle these situations: cross-contract calls or oracle (off-chain) automation can be used for example.

Summary

One must be careful when using the term ‘self-executing’ in context of blockchain programming and indeed there is a lot of literature using the term in a misleading way (‘self-executing computer program’?). While there are ways to automate code execution on blockchain, it instead refers to the properties gained from running programs on top of a permissionless distributed ledger.

An agreement between two parties can be executed — signed and put into effect. But the agreement, it turns out, can be executed in another way as well: the rules in the agreement can be coded into a computer program and deployed on to a blockchain. This agreement can then be called a self-executing smart contract:

  • It is ‘self-executing‘ because it does not need a central authority, employs digital signatures and its state is immutable.
  • And it is ‘smart’ because it is a computer program with many ways to integrate it into our daily lives instead of a paper document that lives in the drawer.

The benefits of self-executing smart contracts are just being discovered. Whether it is to execute by-laws of an organization (DAOs), track offers and shipments, report ESG (environmental, social, and corporate governance) metrics, run binding auctions, execute escrow transactions or digitalize other business processes. Blockchain is not only the technical enabler (with storage, payments and runtime built in) but, more importantly, it enriches the social protocol.

Visit toolblox.net to find out more about the benefits and build self-executing smart contracts and blockchain applications without using any coding skills.

Br,
Silver // Toolblox

[1] How Do Crypto Smart Contracts Work? | CoinGecko

[2] Smart Contract — Overview, How It Works, Role in Blockchain Tech (corporatefinanceinstitute.com)

[3] The Four Doctrines of Self-Executing Treaties (georgetown.edu)

[4] Execution — Definition, Meaning & Synonyms | Vocabulary.com


What are ‘self-executing’ smart contracts? was originally published in CoinsBench on Medium, where people are continuing the conversation by highlighting and responding to this story.

Try out Toolblox

We use AI extensively: ideating tokenization concepts, designing workflows, modelling scenarios, and generating documentation. AI gives us speed and range that manual consulting alone can't match.

For the actual smart-contract code, we take a different approach: contracts are composed from pre-verified, audit-ready building blocks rather than AI-generated. Think of it as Lego: each block is hand-crafted and tested; AI helps you decide which blocks to use and how to arrange them. This gives you the best of both worlds: AI-driven speed for design, and deterministic safety for the code that holds real value on-chain.

Toolblox offers the flexibility traditionally found in custom development combined with the ease of no-code platforms.

Smart-contract templates, while seemingly convenient, often don't cater to all asset classes or jurisdictions, can stifle business process innovation, and become costly when adapting to specific needs due to re-audit requirements. Custom smart-contract development, on the other hand, is a lengthy and expensive process, requiring specialized skills, and the auditing phase is both costly and time-consuming.

Toolblox composes smart contracts from pre-verified modules. You get a solution tailored to your specific asset, jurisdiction, or business nuance, all while being cost-effective to audit and easy to understand through visual workflows.

You do. You can export the full Solidity source code, auto-generated documentation, and integration specs at any time. Once deployed, the smart contract and its data are entirely yours, with no lock-in or dependency on Toolblox to operate.

Yes. Many teams start with the Smart-Contract Builder to explore workflows and prototypes, then bring in a Tokenization Sprint when they need a full blueprint, spec and rapid prototype for a specific deal structure. Everything you build in the self-serve tool carries forward.

Tokenization transforms traditional business protocols into self-executing smart contracts, streamlining operations and ensuring clarity.

  1. Efficiency in Operations: Self-executing contracts automate processes, speeding up operations like reconciliation, administration and settlement.
  2. Reduced Miscommunication: With every term and condition explicitly coded, there's less room for misunderstandings or disputes.
  3. Clarity in Business Protocols: Tokenized assets come with predefined rules and protocols, making business operations clearer and reducing ambiguities.
  4. Liquidity: Assets, even traditionally illiquid ones like art or real estate, become easily tradable, enhancing their accessibility.
  5. Fractional Ownership: Tokenization divides assets into smaller units, allowing more investors to partake in high-value asset ownership.
  6. Transparency: Every transaction is transparently recorded on the blockchain, ensuring verifiability by all stakeholders.
  7. Security: Blockchain's robustness safeguards tokenized assets, minimizing fraud risks.

Integrating smart-contract workflows is straightforward with Toolblox. While there are standard methods like using JavaScript web3 libraries, we offer a user-friendly DApp builder that allows you to embed smart contract actions directly into your solution.

Additionally, for those who prefer no-code platforms, we provide an open API and plugins, including compatibility with popular platforms like Bubble. This ensures a seamless integration tailored to your business needs.

Yes. Toolblox is designed so that non-technical stakeholders can use AI to generate visual workflows and review blueprints. Technical teams can then refine the workflow and export source code.

For the Tokenization Sprint, you only need to describe your deal logic and we handle the rest, delivering a reviewable spec and working prototype.

Cross-workflow calling is built into the builder. Any workflow can call any other workflow, enabling complex multi-asset scenarios and DeFi integrations.

letter send
Contact us Ask us a question or sign up for our newsletter for the latest updates. We care about privacy, and will never share your data.

E-mail address
Sign up for newsletter
Name
Message (optional)