spacemeshos / SMIPS

Spacemesh Improvement Proposals
https://spacemesh.io
Creative Commons Zero v1.0 Universal
7 stars 1 forks source link

Spacemesh Smart Contracts Roadmap (WIP) #62

Open avive opened 2 years ago

avive commented 2 years ago

The goal of this smipp is to reach consensus on Spacemesh smart contracts goals, strategy and tactics.

Status

Early draft for discussion purposes.

Goals

  1. Empower devs to build useful and innovative smart contracts and dapps on the spacemesh platform (apps we can’t imagine ourselves) and make it as easy as possible to do so as complexity is the enemy.
  2. Enable anyone to issue tokens over the Spacemesh platform. E.g. governance, treasury, fungible and non-fungible.
  3. Empower artists to use Spacemesh for issuing NFTs, collections and NFT based communities governance.

Strategy

  1. Provide a high-level language for devs to build SVM smart contracts which should be much easier than coding in Rust.
  2. Add support for turing-complete smart contracts + validators & miners node roles. Provide some simple no-loops core smart contracts after genesis for tokens and NFTs. Bootstrap dev community to build tools, sdk and apis for app devs around the core we are building. E.g. ethers.js, metamask, wallet-connect, etherscan, eth-gas-station, remix, etc… - all of these are needed for a smart contracts dev platform.
  3. Work with existing wallet builders to integrate sm coin, tokens and smart contracts into their wallets. E.g. Coinbase, Samsung, Ledger. This is especially important for the use of smart contracts on mobile.

Tactics

  1. Choose an existing modern open-source smart contract language (and toolset) and build a compiler for it to SVM. Hire compiler and dev-tools tech lead. Start researching existing options now. The decision on the language we pick should be based on pros and cons facts gathered by research and not by opinions and gut feelings. Candidates: Cadence, Solidity. Solidity is the standard for smart contracts in a similar way Javascript is for web apps - it has many limitations and issues but is easy to learn and widely known by smart contract devs.
  2. Build the turing-complete execution platform - separate validators and smeshers node roles - Spacemesh 0.4.
  3. Implement several SVM smart contracts in Rust post genesis and before 0.4 for some tokens and NFTs use cases. Specifically an ERC-721-like contract and several ERC-20 contracts (different patterns). Add support for dynamic data structures in SVM loop-free smart contracts in order to support these kinds of contracts.