# WASM Virtual Machine

## Introduction to the OneFinity WASM VM

The OneFinity VM revolutionizes smart contract execution with its use of Wasmer—an enhanced version tailored to ensure both efficiency and security. By integrating advanced metering for individual WASM opcodes, preemptive execution control, and optimized compilation, OneFinity sets a new standard in VM design. Its prohibition of floating-point operations guarantees the determinism vital for blockchain applications.

#### Core Advancements

* **Fast Execution Engine:** Leveraging Wasmer, known for its JIT streaming compilation, the OneFinity VM achieves near-native speed in executing smart contracts. This results in minimal latency without compromising on performance.
* **Statelessness:** In an innovative approach to maintaining blockchain integrity, the OneFinity VM is designed to be stateless. Smart contracts cannot directly alter the blockchain or storage, eliminating the need for costly revert operations. Instead, all changes are gathered in a transient data structure, applied only upon successful execution. This ensures that the global state remains pristine until execution is conclusively successful.
* **Enhanced Security:** Modifications to Wasmer include capabilities for immediate execution halt, dictated by runtime conditions, and an outright ban on floating-point operations. These ensure a secure, deterministic environment for smart contract execution.

### OneFinity Environment Interface: A Developer's Haven

#### Rust Framework

Though OneFinity VM’s prowess allows for the execution of smart contracts coded in any language compliable to WASM bytecode, it extends particular support to Rust. The OneFinity-provided Rust framework champions developers with its clarity and efficiency, qualities seldom found together in blockchain development. Additionally, it includes a declarative testing framework, streamlining the development process.

#### Why Rust?

Rust's memory safety capabilities and performance metrics make it an ideal candidate for blockchain applications, aligning perfectly with OneFinity's security and efficiency ethos.

### Conclusion

The OneFinity WASM VM is not just another execution engine; it's an innovative leap in smart contract technology. By offering an execution framework that's fast, secure, and developer-friendly, OneFinity is poised to become a cornerstone technology for modern blockchain networks.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onefinity.network/technology/wasm-virtual-machine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
