RiB Newsletter #19 - Rust and smart contracts
Welcome to the #19 edition of Rust in Blockchain, the hypest newsletter about the hypest tech. Previous: #18.
It was a super uneventful December in the Rust blockchain world. Not a lot of GitHub activity, not a lot of technical blog posts to report.
But, in a seemingly monthly tradition, a Rust blockchain launched a mainnet: this time it’s MobileCoin, a fast and private payment network, that uses a combination of CryptoNote, RingCT, and the Stellar Consensus Protocol, all inside of SGX enclaves. Congrats to the MobileCoin team.
Since there’s not much else of note this month, let’s survey a topic that’s been on our minds recently: Rust and smart contracts.
There are a number of blockchains that either run smart contracts written in Rust, or implement their smart contract runtimes or languages in Rust. They fall into a few categories:
-
Those that support Rust compiled to WASM, like Elrond, Holochain, NEAR, Secret Network, Substrate.
These mostly have similar programming models, influenced by Solidity, and all have SDKs for Rust: Elrond’s elrond-wasm-rs, Holochain’s HDK, NEAR’s SDK, Secret Network’s secret-toolkit, and Substrate’s Ink.
-
Those that support Rust compiled to other VMs, like Nervos (RISC-V), and Solana (eBPF).
Nervos contracts are programmed in Rust with their Capsule library. Besides being the only blockchain running RISC-V, Nervos is also a rare smart-contract capable blockchain using the UTXO model instead of the account model.
Solana runs an especially eccentric VM: eBPF. Originally designed as a non-Turing-complete interpreter for running inside OS kernels, eBPF is slowly finding its way into other applications. Did you know Rust supports eBPF? Neither did we! But it kinda does, or LLVM has a backend for it at least; and while Rust doesn’t officially seem to have any in-tree eBPF support, Solana has hacked together a working Rust->eBPF toolchain that includes a fork of the Rust compiler with eBPF support. Fascinating! Upstream that code, Solana! Of course, with eBPF not supporting loops, the Rust here must be quite interesting.
-
Those that use Rust to implement a smart-contract language, like Solang (a Solidity to WASM compiler), Leo (a zero-knowledge language), and Move (Diem’s language).
Although many chains are moving toward general-purpose VMs, particularly to WASM, there are reasons not to, the main two being: wanting Ethereum EVM compatibility, and being based on zero-knowledge proofs. Move is a relatively rare case in that it is both its own language, and its own VM, but does not share the obvious reason to have a custom VM that zero-knowledge languages do.
It is notably impossible to write Rust contracts that target Ethereum’s EVM, which is of course the dominant smart contract platform. Maybe eventually somebody will write an LLVM backend for EVM, and we can change that.
In RiB news, as we’ve mentioned in the past, sometimes we receive inquiries about purchasing ads in RiB. We want to try this, but also to ensure RiB remains a welcoming place for technical discussion and news (and not a cryptocurrency marketing website), and that income generated by RiB supports the broader Rust blockchain community. As such, it is now possible for relevant parties to sponsor RiB in exchange for ad placement on the website, or for a prominent thanks and blurb in the newsletter. Half of sponsorship income is reserved for the RiB community fund. Details of the program are on the website’s sponsorship page. This is our first time running such a program and feedback is welcome in the Telegram group or privately by email.
Thanks
Thanks to contributors:
Adam Gutierrez, Paulii, Brian Anderson, and Aimee Zhu. Thank you for your help!
RiB needs help to keep up with Rust blockchain projects. If you follow a particular project, or otherwise find information that is beneficial to the Rust & blockchain community, please contribute to the next issue by submitting a PR to the #20 draft.
Project Spotlight
Each month we like to shine a light on a notable Rust blockchain project. This month that project is…
Solang is a Solidity compiler implemented in Rust, but it does not target the Ethereum EVM. Instead it uses LLVM as a backend, which means it can potentially target most blockchains that do not run EVM. Currently that includes Substrate, Solana, ewasm, and Sawtooth.
Interesting Things
News
- New launch: MobileCoin Main Net
Blog Posts
- A Brief Breakdown of Monero’s Ongoing Network Attacks
- Understanding Peer-to-Peer Git Forges with Radicle
- An Incomplete Guide to Rollups
- Notes on cross-compiling Rust
Papers
- A Languge-Based Approach to Smart Contract Engineering
- Freedom to (Smart) Contract: The Myth of Code and Blockchain Governance Law
- VM Matters: A Comparison of WASM VMs and EVMs in the Performance of Blockchain Smart Contracts
- RouTEE: A Secure Payment Network Routing Hub using Trusted Execution Environments
- Lockable Signatures for Blockchains: Scriptless Scripts for All Signatures
- Adaptive layer-two dispute periods in blockchains
- Unifying Compilers for SNARKs, SMT, and More
- SoK: Algorithmic Incentive Manipulation Attacks on Permissionless PoW Cryptocurrencies
Projects
- Zinc Framework: the ZK circuit programming language and VM. Zinc is designed specifically for ZK-circuits and ZKP-based smart contract development, so some differences from Rust are inevitable. The official Zinc book.
- aquamarine. Aquamarine is a distributed choreography language & platform.
- MASP. Rust crates for working with the Multi Asset Shielded Pool extensions of the Sapling circuits from Zcash. Intro: A gentle introduction to the multi-asset shielded pool project.
- mev-inspect-rs. Discover historic Miner Extractable Value (MEV) opportunities. A blog post about this project: Flashbots: Frontrunning the MEV Crisis.
- Plasm. The Scaling DApps Platform on Polkadot using Plasma and State Channel.
- plonkit. A zkSNARK toolkit to work with circom zkp DSL in plonk proof system. The project announcement: Announcing FluiDex: Building the first PLONK layer2 DEX on Ethereum and tech intro in detail: Fluidex: A zkrollup layer2 DEX.
- Reverie. Reverie is an implementation (prover and verifier) of the MPC-in-the-head NIZKPoK outlined in Improved Non-Interactive Zero Knowledge with Applications to Post-Quantum Signatures.
- sn_client. A set of libraries providing a way for developers to consume and use the Safe Network facilities.
- sn_node. An Implementation of a Safe Network Vault.
- zkutil. A tool to work with zkSNARK circuits generated by Circom compiler.
Most Active in December
Parity: 204 merged PRs (1, 2, 3, 4, 5), 77 closed issues (1, 2, 3, 4, 5), 60 open issues (1, 2, 3, 4, 5)
Solana: 272 merged PRs (1, 2), 18 closed issues (1, 2), 40 open issues (1, 2)
Zcash: 104 merged PRs (1, 2, 3), 42 closed issues (1, 2, 3), 38 open issues (1, 2, 3)
Project Updates
Aleo
40 merged PRs (1, 2), 24 closed issues (1, 2), 15 open issues (1, 2)
- Blog: How Zero Knowledge is Rebalancing the Scales of the Internet
- PR: Fixes conditional and early returns by @collinc97
- PR: Expression breakout by @Protryon
- PR: Improve pow & mul performance by @ljedrz
Rust Bitcoin
27 merged PRs (1, 2, 3), 5 closed issues (1, 2), 4 open issues (1, 2, 3)
- PR: New PSBT global keys by @dr-orlovsky
- PR: Initiate gossip_queries by @bmancini55
- PR: Make Inventory and NetworkMessage enums exhaustive by @stevenroose
COMIT
68 merged PRs (1, 2), 7 closed issues (1, 2), 11 open issues (1)
- PR: Resume command and global database cl-parameter by @da-kami
- PR: T1Expired state for Bob and check expiries in states after both locked by @da-kami
- PR: Bob refunds swap after restart that requires communication by @D4nte
Fluence
60 merged PRs (1, 2, 3, 4), 1 closed issues (1), 1 open issues (1)
- PR: Introduce security tetraplets by @michaelvoronov
- PR: Send particle.data in base64 through the wire by @folex
- PR: Implement two last fold iterable usage scenarious by @michaelvoronov
Holochain
56 merged PRs (1, 2, 3, 4), 9 closed issues (1, 2, 3), 5 open issues (1, 2)
- News: Holochain Dev Pulse
- Videos:
- PR: Inline zome by @maackle
- PR: [TK-06381] Many fixes to gossip and other parts of holochain by @freesig
Diem
157 merged PRs (1, 2, 3), 7 closed issues (1), 9 open issues (1)
- PR: [move-lang] allow _x to bind but do not warn as unused local by @mengxu-fb
- PR: network: enable having trusted peers even in non-validator networks by @bmwill
- PR: [State Sync] Use checked arithmetic operations to avoid over/underflows. by @JoshLind
Lighthouse
0 merged PRs (), 37 closed issues (1, 2), 33 open issues (1)
MobileCoin
46 merged PRs (1), 2 closed issues (1), 11 open issues (1)
- News: Mechanics of MobileCoin: Chapters 1+2
- PR: Encrypt account key at rest in mobilecoind by @eranrund
- PR: Mobilecoind db encryption: Take 2 by @eranrund
- PR: Wallet service by @sugargoat
NEAR
39 merged PRs (1, 2, 3), 39 closed issues (1, 2), 39 open issues (1, 2, 3)
- News: 2020 NEAR In Review & Ecosystem Tour
- Videos:
- Cross-contract calls in Rust
- NEAR Live Contract Review
- PR: EVM precompile by @ilblackdragon
- PR: add performance metrics feature by @pmnoxx
- PR: feat(testing): bridge testing infrastructure major update by @Kouprin
Nervos
65 merged PRs (1, 2, 3, 4), 10 closed issues (1, 2), 1 open issues (1)
- News:
- Nervos CKB Development Dossier #43, #42
- CKB Weekly: Exploring the Yield Dollar
- PR: doc: network doc by @driftluo
- PR: feat: chaos memory mode by @mohanson
- PR: chain freezer by @zhangsoledad
Parity
204 merged PRs (1, 2, 3, 4, 5), 77 closed issues (1, 2, 3, 4, 5), 60 open issues (1, 2, 3, 4, 5)
- News: Rococo V1 - A Holiday Gift to the Polkadot Community
- Blog:
- PR: Add
pallet
attribute macro to declare pallets by @thiolliere - PR: jaeger integration to debug parachains by @drahnr
- PR: Streamline frame_system weight parametrization by @tomusdrw
- PR: Merkle Mountain Range pallet by @tomusdrw
Secret Network
11 merged PRs (1, 2), 11 closed issues (1), 7 open issues (1)
- News: Secret Network Tokenomics and Ecosystem Pool
- PR: Add init and query calls, docstrings, and examples by @baedrik
- PR: Update secretcli.md by @moonstash
- PR: Creating macros for validator syntax extenstion by @PumpkinSeed
Solana
272 merged PRs (1, 2), 18 closed issues (1, 2), 40 open issues (1, 2)
- News:
- PR: Add poh speed test and calibration logic by @sakridge
- PR: caches staked nodes computed from vote-accounts by @behzadnouri
- PR: Multi-account withdraw added the stake-pool CLI by @ysavchenko
Zcash
104 merged PRs (1, 2, 3), 42 closed issues (1, 2, 3), 38 open issues (1, 2, 3)
- News: ECC Transparency Report for Q2 2020
- Blog: Fuzzing Zcash with Kubernetes
- PR: Replace Tweedle curves with Pasta curves by @ebfull
- PR: Extract permutation argument and introduce typed challenges by @str4d
- PR: Implement Bitcoin Merkle trees by @hdevalence
Events
panic!()
Careers
Aleo | San Francisco, CA; Remote
DFINITY | San Francisco, CA; Palo Alto, CA; Zurich, Switzerland; Remote
Chainflip | Berlin, Germany
Massa | Remote
More jobs can be found at Job Board.
Want to be included in the next issue? Feel free to submit a PR to the #20 draft.
Join the discussion on RiB telegram group ❤️