MCPcopy Index your code
hub / github.com/ETCDEVTeam/sputnikvm

github.com/ETCDEVTeam/sputnikvm @v0.10.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.10.1 ↗ · + Follow
1,198 symbols 1,757 edges 54 files 160 documented · 13% updated 5y agov0.10.0 · 2018-02-13★ 27513 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SputnikVM: A Blockchain Virtual Machine

Build Status License

Name Description Crates.io Documentation
sputnikvm Core library for the Ethereum Virtual Machine crates.io Documentation
sputnikvm-stateful Merkle Trie stateful wrapper for SputnikVM crates.io Documentation

SputnikVM is an implementation of an Ethereum Virtual Machine. It aims to be an efficient, pluggable virtual machine for different Ethereum-based blockchains.

We encourage all Ethereum'esque blockchains to adopt SputnikVM, and to make use of SputnikVM's RFC governance project which governs the parameters of each blockchain's VM. This way we can draw from the experience of the community and learn from other proposed RFCs.

Features

  • Standalone - can be launched as an independent process or integrated into other apps
  • Universal - supports different Ethereum chains, such as ETC, ETH or private ones
  • Stateless - only an execution environment connected to independent State storage
  • Fast - main focus is on performance
  • IoT compatible - designed to support hardware used in embedded devices
  • FFI, Protobuf and JSON interface
  • written in Rust, can be used as a binary, cargo crate or shared library

Supported Networks

Network Crates.io Documentation
Ethereum Classic crates.io Documentation
Ethereum crates.io Documentation
Ellaism crates.io Documentation
Ubiq crates.io Documentation
Expanse crates.io Documentation
Musicoin crates.io Documentation

Precompiled Contracts

The core library has the initial four precompiled contracts embedded. To use the bn128 and modexp precompiled contracts introduced by the Byzantium hard fork, pull the following crates.

Name Description Crates.io Documentation
sputnikvm-precompiled-bn128 bn128 precompiled contracts crates.io Documentation
sputnikvm-precompiled-modexp modexp precompiled contracts crates.io Documentation

Related projects

  • SputnikVM Dev - SputnikVM instance for Smart Contract development, provides testing environment and mock for JSON RPC API
  • SputnikVM in Browser - experimental version of SputnikVM compiled into WebAssembly, therefore can be launched in a browser on Node.js
  • SputnikVM for embedded devices - experimental project to run on full functional EVM on embedded devices

Dependencies

Ensure you have at least rustc 1.16.0 (30cf806ef 2017-03-10). Rust 1.15.0 and before is not supported.

Documentation

Build from sources

SputnikVM is written Rust. If you are not familiar with Rust please see the getting started guide.

Build

To start working with SputnikVM you'll need to install rustup, then you can do:

$ git clone git@github.com:ethereumproject/sputnikvm.git
$ cd sputnikvm
$ cargo build --release --all

Testing

We currently use two ways to test SputnikVM and ensure its execution aligns with other Ethereum Virtual Machine implementations:

  • jsontests: This uses part of the Ethereum tests. Those tests currently does not have good coverage for system operation opcodes. Besides, some tests are incorrect so they are disabled.
  • regtests: A complete regression tests is done on the Ethereum Classic mainnet from genesis block to block 4 million. Some of the previously failed tests are also integrated into Rust's test system. See wiki for how to reproduce the regression tests.

To learn more about building SputnikVM from source please read wiki page Building and Testing

License

Apache 2.0

Extension points exported contracts — how you extend this code

Precompiled (Interface)
Represent a precompiled contract. [9 implementers]
src/patch/precompiled.rs
VM (Interface)
Represents an EVM. This is usually the main interface for clients to interact with. [2 implementers]
src/lib.rs
Memory (Interface)
Represent a memory in EVM. Read should always succeed. Write can fall. [1 implementers]
src/memory.rs
GethRPCClient (Interface)
(no doc) [3 implementers]
gethrpc/src/lib.rs
AccountPatch (Interface)
Account patch for account related variables. [11 implementers]
src/patch/mod.rs
Patch (Interface)
Represents different block range context. [20 implementers]
src/patch/mod.rs

Core symbols most depended-on inside this repo

into
called by 143
src/util/opcode.rs
peek
called by 96
src/eval/mod.rs
check_pop_push
called by 67
src/stack.rs
get
called by 43
src/commit/blockhash.rs
clone
called by 37
src/commit/account.rs
push
called by 32
src/stack.rs
clone
called by 30
stateful/src/lib.rs
commit_account
called by 29
src/eval/mod.rs

Shape

Function 720
Method 376
Class 76
Enum 20
Interface 6

Languages

Rust100%

Modules by API surface

jsontests/tests/arithmetic.rs195 symbols
jsontests/tests/flow.rs145 symbols
jsontests/tests/pushdupswap.rs73 symbols
jsontests/tests/bitwise.rs60 symbols
jsontests/tests/environment.rs51 symbols
gethrpc/src/lib.rs47 symbols
jsontests/tests/log.rs46 symbols
src/transaction.rs32 symbols
src/commit/account.rs32 symbols
src/patch/mod.rs30 symbols
network/foundation/src/lib.rs29 symbols
network/expanse/src/lib.rs28 symbols

For agents

$ claude mcp add sputnikvm \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact