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

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

Blog Posts

Papers

Projects

 

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)

Rust Bitcoin

27 merged PRs (1, 2, 3), 5 closed issues (1, 2), 4 open issues (1, 2, 3)

COMIT

68 merged PRs (1, 2), 7 closed issues (1, 2), 11 open issues (1)

Fluence

60 merged PRs (1, 2, 3, 4), 1 closed issues (1), 1 open issues (1)

Holochain

56 merged PRs (1, 2, 3, 4), 9 closed issues (1, 2, 3), 5 open issues (1, 2)

Diem

157 merged PRs (1, 2, 3), 7 closed issues (1), 9 open issues (1)

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)

NEAR

39 merged PRs (1, 2, 3), 39 closed issues (1, 2), 39 open issues (1, 2, 3)

Nervos

65 merged PRs (1, 2, 3, 4), 10 closed issues (1, 2), 1 open issues (1)

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)

Secret Network

11 merged PRs (1, 2), 11 closed issues (1), 7 open issues (1)

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)

 

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 ❤️