QoreChain's triple-VM architecture (EVM, CosmWasm, SVM) allows smart contracts on any virtual machine to communicate with contracts on any other VM. The x/crossvm module provides both synchronous and asynchronous messaging paths.
The synchronous path uses an EVM precompile at address 0x0000000000000000000000000000000000000901. This allows Solidity contracts to call CosmWasm contracts and receive a response within the same transaction.
Solidity Example
The precompile executes the CosmWasm contract immediately and returns the result. Gas cost: 50,000 base + execution cost.
Asynchronous Path
All other cross-VM directions use the asynchronous message queue. Messages are submitted in one block and processed by the EndBlocker in the next block.
CLI
Message Lifecycle
Every cross-VM message transitions through a defined set of states:
State
Description
Submitted
Message accepted into the queue
Pending
Awaiting execution in the next EndBlocker pass
Executed
Target contract called successfully; response recorded
Failed
Target contract execution reverted; error recorded
Timed Out
Message exceeded queue_timeout_blocks without execution
Atomicity: Synchronous calls (EVM to CosmWasm via precompile) are atomic -- if either side reverts, the entire transaction reverts. Asynchronous calls are not atomic across blocks; design your contracts to handle the Failed and Timed Out states gracefully.
Ordering: Messages in the queue are processed FIFO within each EndBlocker pass. There is no guaranteed ordering across different source VMs.
Payload encoding: The payload format depends on the target VM:
EVM targets: ABI-encoded function calls
CosmWasm targets: JSON-encoded execute messages
SVM targets: Hex-encoded BPF instruction data
Next Steps
EVM Precompiles -- The synchronous CrossVM precompile and other custom precompiles
EVM Development -- Solidity development on QoreChain
CosmWasm Development -- Rust/Wasm contract development
wscat -c ws://localhost:26657/websocket
> {"jsonrpc":"2.0","method":"subscribe","params":["tm.event='Tx' AND crossvm_request.message_id EXISTS"],"id":1}
# Query a specific message by ID
qorechaind query crossvm message <message-id>
# List all pending messages
qorechaind query crossvm pending
# List messages by sender
qorechaind query crossvm messages-by-sender <address>