#vm #ckb

ckb-vm

CKB’s Virtual machine

7 releases (breaking)

✓ Uses Rust 2018 edition

0.17.0 Sep 25, 2019
0.16.0 Sep 10, 2019
0.15.1 Jul 27, 2019
0.14.0 Jun 10, 2019
0.0.0 Nov 2, 2018
Download history 482/week @ 2019-06-12 541/week @ 2019-06-19 595/week @ 2019-06-26 458/week @ 2019-07-03 456/week @ 2019-07-10 759/week @ 2019-07-17 531/week @ 2019-07-24 349/week @ 2019-07-31 1142/week @ 2019-08-07 660/week @ 2019-08-14 1343/week @ 2019-08-21 980/week @ 2019-08-28 1284/week @ 2019-09-04 693/week @ 2019-09-11 1170/week @ 2019-09-18

3,452 downloads per month

MIT license

1.5MB
11K SLoC

Rust 5K SLoC // 0.1% comments C 4.5K SLoC // 0.2% comments Assembly 1K SLoC

Nervos CKB VM

Build Status Build Status dependency 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 IMC 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 project is still in development, it's NOT in production ready status.

The master branch is regularly built and tested, but is not guaranteed to be completely 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-1.32.0 on Linux and macOS.

# 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).

Dependencies