| domain | shortname | name | status | editor |
|---|---|---|---|---|
rfc.ethereumclassic |
16/EVMJSON |
EVM JSON-RPC |
raw |
Wei Tang <hi@that.world> |
JSON-RPC is a stateless, lightweight remote procedure call (RPC) protocol. This specification describes the JSON-RPC API that should be provided by an EVM implementation.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
An EVM that supports JSON-RPC MUST provide an endpoint for calling.
Bytearrays are transferred using hex value encoding. The string MAY optionally start with "0x" followed by 0-9a-f. The string MUST be even number of digits.
As a result, several hex value encodings that are considered wrong in Ethereum JSON-RPC ("0x", for example, in this specification represents an empty bytearray) would have no problem in EVM JSON-RPC.
Creates a new VM using the given block header and context. It returns an ID that represents this VM.
BlockHeaderstruct: contains the block header information.Contextstruct: contains the current execution context.Patch: a unique number that represents the current patch version of the block.
coinbase: 20 bytes address.timestamp: 32 bytes.number: 32 bytes.difficulty: 32 bytes.gas_limit: 32 bytes gas.
address: 20 bytes address.caller: 20 bytes address.code: bytearray for the code to run.data: bytearray for the data to be passed. Should be empty when the transaction is contract creation.gas_limit: 32 bytes.gas_price: 32 bytes.origin: 20 bytes address. Usually the same ascaller.value: ether to be passed in this transaction. The client is responsible to make sure that the caller has enough balance to pay.
An integer that represents the current VM.
Fire an existing VM.
evm_id: an integer that is the VM id.
Either "ok", {"requireAccount": "{address}"},
{"requireAccountCode": "{address}"} or {"requireBlockhash": "{number}"}.
Commit an account into the VM. The client is then not supposed to modify the account if it wants to accept the result of the VM later.
evm_id: an integer that is the VM id.address: 20 bytes address.Accountstruct: contains the full account information.
nonce: 32 bytes.balance: 32 bytes.storage: a struct, where the key is a non-zero-value index, and the value is the corresponding value in the storage.code: bytearray for the code in the account.
Either "ok" or {"error": "{message}"}.
Commit the code of an account into the VM.
evm_id: an integer that is the VM id.address: 20 bytes address.code: bytearray for the code in the account.
Either "ok" or {"error": "{message}"}.
Commit a blockhash into the VM.
evm_id: an integer that is the VM id.number: 32 bytes.hash: 32 bytes.
Either "ok" or {"error": "{message}"}.
Returns the current account status in the VM.
evm_id: an integer that is the VM id.
A struct.
fulls: a struct where key is an address, and value is anAccountstruct.increases: balances to increase for accounts. Key is an address, and value is the balance to be increased.
Returns the logs to be appended if the client decides to accept the VM's result.
evm_id: an integer that is the VM id.
An ordered array, where values are Log structs.
address: 20 bytes address.data: bytearray for the data of the log.topics: array of 32 bytes.
Returns the out value of the VM execution result.
evm_id: an integer that is the VM id.
A bytearray that is the out value of the VM.