NEAR developers pulled off one of the riskiest and most technically complex operations in modern blockchain: they replaced the virtual machine executing all smart contracts directly in the live mainnet. And the most astonishing part — the vast majority of users and developers didn't even notice.
For a long time, the heart of NEAR was the custom virtual machine NearVM — a fork of the Wasmer engine. This "proprietary compiler" was a real "tax" on innovation: every Rust update, every new security feature became a burden solely on the project's team. The project once got incredibly lucky: it accidentally missed syncing with upstream just before a critical vulnerability was discovered in the original Wasmer. But relying on luck in blockchain is an unacceptable luxury.
The choice fell on Wasmtime — an industry standard supported by the Bytecode Alliance. To prove the safety of the transition, network nodes ran real traffic through both virtual machines in parallel, cross-checking every result. The results were impressive: complete match of outcomes, a difference in fees of less than 0.002%, and execution speed increased by approximately four times.
Forbidden solution and engineering ingenuity
The main difficulty, however, was not in execution. In the NEAR network, contract deployment is compiled directly within a block lasting 600 milliseconds. The optimizing compiler has no upper time limit, which opened the door for an attack. The team created a test contract of 128 KB, whose compilation took about 7 seconds — enough to "miss" the block and slow down the entire network.
The seemingly obvious solution was to set a hard time limit on compilation. But this turned out to be forbidden: different validators spend different amounts of time on compilation, and a borderline contract would be accepted by some nodes but rejected by others, leading to a network split. Consensus requires complete predictability even at the build time level.
The team found an elegant way out. They implemented Winch — a single-pass backend for Wasmtime — and added the missing functions to it. The result exceeded expectations: the "worst-case compilation" dropped from 7.6 seconds to 36 milliseconds. Working off-chain provided a "luxury unavailable to the protocol": compilation can be offloaded to a separate type of handler not tied to executing nodes.
The release of Nearcore 2.12 switched NEAR's execution environment from NearVM to Wasmtime. For developers and users, nothing changed — and that's the whole point. The team closed a critical technical debt without breaking anything. This is the level of engineering culture that rarely makes headlines, but it is precisely what distinguishes mature blockchain networks from experimental projects.
Analyst's opinion: The migration to Wasmtime is not just a routine update. It is a strategic step that removes the burden of maintaining a fork from the NEAR team and connects the project to industry-wide security standards. The 4x speed increase is a nice bonus, but the main thing here is eliminating the attack vector through "compilation slowdown" and ensuring the network's long-term sustainability. This is a case where "quiet" work speaks louder about a project's maturity than any loud statements.