• Stars
    star
    355
  • Rank 119,764 (Top 3 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 6 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CKB's vm, based on open source RISC-V ISA

Nervos CKB VM

Build Status Build Status codecov


About CKB VM

CKB VM is a pure software implementation of the RISC-V instruction set used as scripting VM in CKB. Right now it implements full IMCB instructions for both 32-bit and 64-bit register size support. In the future we might also implement V extensions to enable better crypto implementations.

License

Nervos CKB is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT.

Development Process

This is now deployed and used in production CKB mainnet.

The develop branch is regularly built and tested, but is not guaranteed to be completely stable. CKB will use released versions of CKB VM which are tested and more stable.

The contribution workflow is described in CONTRIBUTING.md, and security policy is described in SECURITY.md. To propose new protocol or standard for Nervos, see Nervos RFC.


How to build

CKB VM is currently tested mainly with stable Rust version on 64-bit Linux, macOS, and Windows.

# download CKB VM
$ git clone https://github.com/nervosnetwork/ckb-vm
$ cd ckb-vm
$ cargo build

You can also run the tests:

make test

CKB VM has already included RISC-V binaries used in tests, so you don't need a RISC-V compiler to build binaries. However if you do want to play with your own binaries, a RISC-V compiler might be needed. riscv-tools can be a good starting point here, or if you are an expert on GNU toolchain, you might also compile upstream GCC from source with RISC-V support, here is an example. CKB VM is using standard RISC-V instructions and ELF binary format, so theoretically any RISC-V compatible compilers are able to produce contracts used in CKB VM(tho bug reports are very welcome if you find breakage).

Notes on Different Modes

Right now CKB VM has 2 different modes:

  • Rust interpreter mode
  • Assembly based interpreter mode(ASM mode)

For consistent behavior, you should only use ASM mode. The Rust mode is developed more to assist development, and never used in production by us. In case of bugs, there might be inconsistent behaviors between Rust mode and ASM mode.

More Repositories

1

ckb

The Nervos CKB is a public permissionless blockchain, and the layer 1 of Nervos network.
Rust
1,156
star
2

rfcs

This repository contains proposals, standards and documentations related to Nervos Network.
Python
253
star
3

neuron

Neuron: Nervos CKB Wallet
TypeScript
188
star
4

muta

Muta is a high-performance blockchain framework.
Rust
172
star
5

muta-minits

TypeScript to LLVM compiler
TypeScript
133
star
6

ckb-explorer-frontend

Nervos CKB Explorer Frontend
TypeScript
110
star
7

faster-hex

fast hex
Rust
80
star
8

overlord

Overlord consensus protocol.
Rust
78
star
9

capsule

Capsule is an out-of-box development framework for creating smart contract on Nervos' CKB.
Rust
60
star
10

godwoken

Godwoken is an optimistic rollup solution builtin upon Nervos CKB.
Rust
58
star
11

ckb-cli

CKB command line interface
Rust
55
star
12

merkle-mountain-range

A generalized merkle mountain range implementation.
Rust
52
star
13

binary

51
star
14

lumos

A full featured dapp framework for Nervos CKB
JavaScript
50
star
15

sparse-merkle-tree

Rust
46
star
16

ckb-sdk-js

JavaScript SDK for CKB
JavaScript
38
star
17

ckb-explorer

CKB Explorer
Ruby
37
star
18

force-bridge

General Force Bridge components.
TypeScript
36
star
19

molecule

Another serialization system: minimalist and canonicalization.
Rust
36
star
20

ckb-system-scripts

CKB's official system scripts. Those contracts will be included in system cells in genesis blocks
C
36
star
21

force-bridge-eth

Decentralized, trustless bridge between Ethereum and Nervos.
Rust
33
star
22

ckb-miner

ckb miner for avx2 cpu, avx512 cpu and GPU
Rust
31
star
23

ckb-indexer

Rust
29
star
24

ckb-sdk-java

Java SDK for CKB
Java
27
star
25

ckb-demo-ruby

CKB Demo Ruby SDK
Ruby
27
star
26

ckb-std

This library contains serveral modules that could help you write CKB contract with Rust.
Rust
26
star
27

mercury

Building on top of ckb-indexer, Mercury provides handy integration features for Nervos CKB.
Rust
23
star
28

merkle-tree

A library for generating efficient Merkle tree and Merkle proof based on complete binary tree
Rust
21
star
29

ckb-standalone-debugger

A standalone debugger enabling off-chain contract development
Rust
21
star
30

ckb-sdk-go

Go
21
star
31

ckb-sdk-ruby

Ruby SDK for CKB
Ruby
20
star
32

ckb-sdk-rust

Rust SDK for Nervos CKB
Rust
20
star
33

polyjuice

An Ethereum on CKB solution
Rust
19
star
34

docs.nervos.org

Nervos CKB Documentation, curated by Nervos Foundation, contributed by the Nervos Community with ❀️.
MDX
18
star
35

tippy

One click CKB devnet
CSS
18
star
36

ckb-production-scripts

C
18
star
37

fiber

Rust
18
star
38

godwoken-polyjuice

An Ethereum compatible backend for Godwoken rollup framework.
C
17
star
39

axon

Axon is a layer2 of CKB that is compatible with Ethereum.
Rust
17
star
40

nervos-web

TypeScript
16
star
41

ckb-miscellaneous-scripts

Interesting and useful CKB scripts which aren't necessarily in system scripts
C
15
star
42

docs

The old and deprecated Nervos CKB Documentation, see https://github.com/nervosnetwork/docs-new for the new one, kept here only for reference reasons.
JavaScript
15
star
43

godwoken-web3

TypeScript
14
star
44

ckb-light-client

CKB light client reference implementation
Rust
14
star
45

mandrake

mandrake the animagus gui
Dart
12
star
46

polyjuice-old

An Ethereum on CKB solution
Rust
12
star
47

layer2-evm-documentation

Use Ethereum contracts & tools to build on Nervos
JavaScript
12
star
48

force-bridge-btc

force-bridge-btc maps BTC on Bitcoin to cBTC on CKB in a trustless way.
Rust
11
star
49

ckb-contract-guidelines

Rust
10
star
50

faketime

Provides a method unix_time which returns elapsed time since UNIX EPOCH. The returned time can be faked in each thread separately.
Rust
10
star
51

dapps-on-ckb-workshop-code

Rust
10
star
52

ckb-cuckoo-miner-gpu

Please use the new repo:
Rust
10
star
53

ckb-js-toolkit

JavaScript
10
star
54

grants

9
star
55

ckb-c-stdlib

C
8
star
56

rust-kvstore-bench

Rust
8
star
57

ckb-simple-account-layer

An account layer implementation for Nervos CKB
C
8
star
58

mruby-contracts

mruby based contract creator, allows writing contracts using Ruby
C
8
star
59

polyjuice-provider

Godwoken-Polyjuice compatible providers for ethereum library
JavaScript
8
star
60

moleculec-es

ECMAScript plugin for the molecule serialization system
Go
8
star
61

keyper

TypeScript
8
star
62

godwoken-info

Godwoken Public Network Information
Shell
7
star
63

bloom-filters

Rust
7
star
64

ckb-vm-pprof

6
star
65

eaglesong

Rust
6
star
66

godwoken-scripts

Godwoken scripts
Rust
6
star
67

force-bridge-ui

Front-end of force bridge
TypeScript
6
star
68

cfb

CFB (Canonical FlatBuffers) is a restricted variant of FlatBuffers for producing unequivocal transfer syntax.
Rust
6
star
69

ckb-tool

Moved to https://github.com/nervosnetwork/capsule/tree/develop/crates/testtool
Rust
5
star
70

clerkb

A Proof of Authority library working on Nervos CKB.
Rust
5
star
71

blake2b-rs

C
5
star
72

muta-sdk-js

Muta JavaScript SDK
TypeScript
5
star
73

godwoken-examples

JavaScript
5
star
74

wasm-secp256k1-test

A demo showcasing running WASM programs on CKB VM
Rust
4
star
75

ckb-contract-debugger

A debugger used to aid CKB contract development. CLI based for now, might expand to web later.
Rust
4
star
76

muta-utils

Some utilities for muta.
Rust
4
star
77

serde_bench

Rust
4
star
78

ckb-js-vm

Write scripts in JavaScript on CKB-VM
C
4
star
79

ckb-binary-patcher

Rust
4
star
80

fiber-scripts

Rust
4
star
81

ckit

ckb apps toolkit
TypeScript
3
star
82

muta-devops

TypeScript
3
star
83

nervos-bot

Ruby
3
star
84

neuron-key-manager

Neuron Key Manager
TypeScript
3
star
85

muta-docs

Muta Docs
JavaScript
3
star
86

slice-cheatcheat

Cheatsheet for slice syntax in different languages, maintained by the Nervos team
TeX
3
star
87

fiber-archive

Channel network built on Nervos CKB.
3
star
88

ckb-ruby-scripts

CKB Ruby scripts
Ruby
3
star
89

wasm-ckb-syscall-demo

A demo showcasing CKB scripts with syscalls in Rust
Rust
2
star
90

muta-tutorial-attestation

An attestation chain example based muta framework.
Rust
2
star
91

ckb-bench-archived

Rust
2
star
92

axon-prototype-2

Rust
2
star
93

muta-tutorial-dex

Simple dex demo based on muta blockchain framework
Rust
2
star
94

ckb-testnet-faucet

The CKB testnet faucet
Swift
2
star
95

muta-template

Muta framework template
Rust
2
star
96

ethash

Rust
2
star
97

ckb-script-error-codes

This is a wiki to collect documentations about error codes returned by various ckb scripts.
2
star
98

ckb-x64-simulator

Rust
2
star
99

ckb-vm-test-suite

Test suite for CKB VM, kept in a separate project to avoid polluting the vm repo with submodules
Shell
2
star
100

ckb-helpdesk-zh

CKB Helpdesk - δΈ­ζ–‡
1
star