Safe and Simple Rust Smart Contracts in NEAR
summary
NEAR runs Rust contracts compiled to WASM and uses WASI/WASMER tooling, with a non‑invasive API that turns ordinary Rust into on‑chain code by applying procedural macros (one decorator) to generate contract and storage interfaces. Contracts are small — typically 20–40KB for simple logic, up to ~200KB with more features — support synchronous cross‑contract calls via promises and callbacks, allow unit/integration testing through dependency‑injection traits, and the team runs an EVM‑inside‑WASM prototype; the system is implemented and actively used.
AI-written summary · about
chapters (22)
- 0:00Intro
- 0:21Smart Contracts & AWS Lambda
- 1:59A Smart Contract
- 2:48Immutable History of Events
- 3:44Fat Fingers and Bugs in Closed Code
- 6:43Inside a Node
- 9:51Requirements for VM
- 12:15WASM + Rust Bonus Points
- 12:45Rust Zero-Cost Abstractions
- 13:17Rust APIs
- 14:04Contract Interface and Blockchain Interface
- 17:12near_bindgen (non-invasive)
- 18:15How Does It Work
- 19:49Generating eDSL style API
- 22:18Nice to Have Features
- 22:42Asynchronous Calls
- 23:18Unit Tests and Integration Tests
- 23:42Dependency Inversion and Dependency Injection
- 24:05Unit Testing Contract A
- 24:18Integration Testing Contracts A and B
- 24:28Async Cross-Contract Calls
- 30:32WASI – Path to Unification WASI is a modular system interface for WebAssembly.
related talks
42mEngineering JavaScript for Web3
20mUsing Rust and WASM
01h 27mWorkshop: NEAR 101
22mWebAssembly beyond the browser
13mRust and WebAssembly
44mOut of the JavaScript Box: Front-End Rust Programming
30mWASM in the Wild West: A Practical Application Tale
30mRust in the Browser for Javascripters:New Frontiers,New Possibilities
