• Stars
    star
    130
  • Rank 277,575 (Top 6 %)
  • Language
    HTML
  • License
    Other
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

Semantics of Virtual Machine for IELE prototype blockchain

IELE: Semantics of New Blockchain VM in K

In this repository we provide a model of IELE in K.

Structure

  • The file iele-syntax.md contains the syntax definition of IELE, along with comments that guide the reader through the structure of the language and links to more detailed descriptions of various features. This file is a good starting point for getting familiar with the language.
  • The file data.md explains the basic data of IELE (including words and some datastructures over them). This data is defined functionally.
  • iele.md is the file containing the semantics of IELE. This file contains the configuration (a map of the state), and a simple imperative execution machine which IELE lives on top of. It deals with the semantics of opcodes and parsing/unparsing/assembling/disassembling.
  • iele-gas.md describes gas price computations. iele-gas-summary.md summarizes them in a format readable by those who don't know K.
  • iele-binary.md defines the mnemonic for each opcode, and the disassembler.
  • iele-node.md defines the protobuf communication protocol used to plug the IELE VM into anonther client to make a full node.
  • iele-testing.md loads test-files from the Ethereum Test Set and executes them, checking that the output is correct. If the output is correct, the entire configuration is cleared. If any check fails, the configuration retains the failed check at the top of the <k> cell. iele-testing.md is also capable of executing tests of arbitrary IELE transactions (subject to the fact that this first release of IELE is still built on top of an ethereum-like network layer). The test format is based off of, but slightly different from, the ethereum BlockchainTest json test format.

Using the Definition

Installing/Building

See INSTALL.md.

Help/Version

Calling kiele help and kiele version will output the user guide and the KIELE version, respectively.

Assembler

The assembler takes textual IELE and produces IELE bytecode. For example, on the following file iele-examples/factorial.iele:

contract Factorial {

  define public @factorial(%n) {
    %lt = cmp lt %n, 0
    br %lt, throw

    %result = 1

  condition:
    %cond = cmp le %n, 0
    br %cond, after_loop

  loop_body:
    %result = mul %result, %n
    %n      = sub %n, 1
    br condition

  after_loop:
    ret %result

  throw:
    call @iele.invalid()
  }

  define @init() {}
}

You can run:

kiele assemble iele-examples/factorial.iele

To produce output:

0000004C6303690009666163746F7269616C6800010001618001100042650003026101036600006180011200446500020466000102001B610101030040640000660002F6000103660003FE6700000000

NOTE: Right now, if you use the NixOS package, you must call iele-assemble instead of kiele assemble.

KIELE Node

You can run a KIELE node, specifying the port to run on and use the KIELE test harness to run some transactions through it. To start the KIELE node, call (in one terminal):

kiele vm --port 9001

Then in a separate terminal, send a transaction through:

iele-test-vm tests/iele/danse/factorial/factorial_positive.iele.json 9001

You'll see the launched node record to the terminal a list of messages it sends and receives.

NOTE: The iele-test-vm executable is only available in a from-source build of KIELE. You can still launch and use the KIELE VM node without this executable.

Interpreter

Tests in the Ethereum Test Suite format can be run directly by the IELE interpreter.

For example, from this repository, you can run:

make assemble-iele-test -j4

To prepare the Ethereum test-suite. Then you can run an individual test, and see the post-state with:

kiele interpret tests/iele/danse/factorial/factorial_positive.iele.json.test-assembled

You may also run the interpreter with the Haskell backend instead (though it is significantly slower):

kiele interpret --backend haskell tests/iele/danse/factorial/factorial_positive.iele.json.test-assembled

NOTE: Printing the post-state will not work unless you are using a from-source build of KIELE. Instead, you should inspect the exit code of kiele interpret to see if the test passed or failed, by adding option --no-unparse to skip printing the post-state.

Well-Formedness Checker

The KIELE well-formedness checker will do some type-checking on the input IELE program, using exit code to indicate success/failure. For example, we can type-check the ERC20 contract example iele-examples/erc20.iele:

kiele check --schedule DANSE iele-examples/erc20.iele

NOTE: The KIELE well-formedness checker requires that (i) you are using a local build of KIELE, and (ii) you have installed K as well.

Contacting Us

To reach us, you can either use our chat, or open issues against this repository:

More Repositories

1

verified-smart-contracts

Smart contracts which are formally verified
Solidity
717
star
2

evm-semantics

K Semantics of the Ethereum Virtual Machine (EVM)
Python
507
star
3

k

K Framework Tools 7.0
Java
447
star
4

haskell-backend

The symbolic execution engine powering the K Framework
Haskell
210
star
5

publications

Publications of Runtime Verification, Inc.
HTML
87
star
6

wasm-semantics

A Prototype Formal Semantics of WebAssembly in K
WebAssembly
78
star
7

kontrol

Python
49
star
8

erc20-semantics

ERC20 in K
47
star
9

javamop

Runtime verification system for Java, using AspectJ for instrumentation.
Java
44
star
10

llvm-backend

KORE to llvm translation
C++
31
star
11

deposit-contract-verification

Makefile
30
star
12

plutus-core-semantics

Haskell
27
star
13

algorand-verification

Formal verification of the Algorand consensus protocol
Coq
26
star
14

beacon-chain-spec

Formalization of the Beacon Chain Phase 0 Specification in K
TeX
20
star
15

python-semantics

The semantics of Python in K
Python
19
star
16

beacon-chain-verification

TeX
18
star
17

michelson-semantics

A K semantics of Tezos' Michelson language.
Makefile
17
star
18

casper-proofs

Coq definitions and lemmas for verification of Casper
TeX
17
star
19

solidity

Fork of the Solidity Compiler for compiling Solidity to IELE
C++
16
star
20

rv-monitor

RV-Monitor core system code
Java
15
star
21

avm-semantics

Python
15
star
22

pyk

Python tools for the K Framework
Python
13
star
23

foundry-upgradeable-contracts-examples

Example tests for exploring upgradeable contracts with Foundry
Solidity
13
star
24

kontrol-demo

Foundry blog posts' executable demos
Solidity
12
star
25

zero-to-k-tutorial

Makefile
12
star
26

simbolik-vscode

TypeScript
12
star
27

k-editor-support

Plugin files for editing K files
Java
11
star
28

erc777-semantics

Makefile
11
star
29

mpfr-java

GNU MPFR Java Bindings
Java
10
star
30

kontrol-solady

Solady formal verification with Kontrol
Solidity
10
star
31

polkadot-verification

Verification of Polkadot WASM code
WebAssembly
9
star
32

secureum-kontrol

Solidity
9
star
33

kontrol-cheatcodes

Cheatcodes library for your symbolic Kontrol tests
Solidity
9
star
34

blockchain-k-plugin

K plugin for IELE and KEVM
C++
8
star
35

bn128-ml

BN 128 elliptic curve implementation in OCAML (for Ethereum zero-knowledge proofs)
OCaml
8
star
36

knock

Nock semantics in K
Python
7
star
37

mx-semantics

Python
7
star
38

rdao-smc

A probabilistic rewriting model of Randao-based RNG schemes
TeX
7
star
39

hs-backend-booster

Accelerates K Framework's Haskell backend
Haskell
7
star
40

proof-generation

Python
6
star
41

kup

K and Semantics Distribution Tool
Python
6
star
42

kavm-demo

Python
6
star
43

rv-android

Android runtime library for the RV-Monitor environment.
Java
5
star
44

match

RV-Match issue tracker and releases
4
star
45

gitbook-kontrol

4
star
46

imp-semantics

The K semantics of IMP and associated tools
Python
4
star
47

predict

3
star
48

vlsm

Coq
3
star
49

property-db

An annotated Java API and a tool for generated documentation augmented with properties.
Java
3
star
50

k-vs-coq-language-frameworks

Coq
3
star
51

pl-tutorial

The K Programming Language Tutorial
Standard ML
3
star
52

rv-predict

Code for improved rv-predict and installer
C
2
star
53

evaluation

Evaluation results of RV tools and comparisons with other tools
Python
2
star
54

rvmatch-eclipse-plugin

Java
2
star
55

kontrol-tutorial

Solidity
2
star
56

khoon

Python
2
star
57

optimism-ci

CI Hosting Symbolic Execution for Ethereum-Optimism
2
star
58

llvmmop

MOP framework for LLVM
Java
2
star
59

CANtools

RV tools for reverse engineering the automotive CAN bus.
1
star
60

rv-toolkit-docs

HTML
1
star
61

racy-c-programs

Benchmark of C/C++ programs exhibiting races.
C++
1
star
62

test-maven-deployment

Test - Delete me
1
star
63

rv-match_testing

Shell
1
star
64

z3k

C++ type inferencer for K using libz3
C++
1
star
65

k-pldi-tutorial

Code supporting K tutorial session at PLDI 2023.
Shell
1
star
66

elrond-multisig

Starlark
1
star
67

gitbook-kevm

1
star
68

proof-checker-public

C++
1
star
69

mir-semantics

Python
1
star
70

kore-prof

Profiling utilities extracted from haskell-backend
Haskell
1
star
71

RV-Log

Frontend for feeding log files and other precomputed event traces to RV-Monitor.
Java
1
star
72

mir-semantics-compiletest

Test suite for MIR semantics
Rust
1
star
73

gitbook-home

1
star
74

riscv-gnu-toolchain-images

Docker image builds for the RISC-V GNU toolchain
Dockerfile
1
star
75

nailgun

Nailgun is a client, protocol, and server for running Java programs from the command line without incurring the JVM startup overhead.
Java
1
star
76

ercx-vscode

VSCode support for ERCx
TypeScript
1
star
77

simbolik-examples

Solidity
1
star
78

rv-install

Unified installer for all Runtime Verification Inc. products
Java
1
star