#blockchain #sdk #wasm

bin+lib linera-sdk

Library to support developping Linera applications in Rust

3 releases (breaking)

new 0.6.0 Nov 27, 2023
0.5.0 Oct 27, 2023
0.4.1 Sep 25, 2023
0.4.0 Aug 29, 2023
0.0.1 Apr 29, 2023

#2873 in Magic Beans

Download history 20/week @ 2023-08-06 14/week @ 2023-08-13 15/week @ 2023-08-20 44/week @ 2023-08-27 14/week @ 2023-09-03 31/week @ 2023-09-10 45/week @ 2023-09-17 119/week @ 2023-09-24 47/week @ 2023-10-01 50/week @ 2023-10-08 20/week @ 2023-10-15 51/week @ 2023-10-22 29/week @ 2023-10-29 27/week @ 2023-11-05 14/week @ 2023-11-12 24/week @ 2023-11-19

99 downloads per month


19K SLoC

This module provides an SDK for developing Linera applications using Rust.

A Linera application consists of two WebAssembly binaries: a contract and a service. In both binaries, there should be a shared application state. The state is a type that represents what the application would like to persist in storage across blocks, and must implement the Contract trait in the contract binary and the Service trait in the service binary.

The application can select between two storage backends to use. Selecting the storage backend is done by specifying both the Contract::Storage and the Service::Storage associated types.

The SimpleStateStorage backend stores the application's state type by serializing it into binary blob. This allows the entire contents of the state to be persisted and made available to the application when it is executed.

The ViewStateStorage backend stores the application's state using the linera-views, a framework that allows loading selected parts of the state. This is useful if the application's state is large and doesn't need to be loaded in its entirety for every execution.

The contract binary should use the contract! macro to export the application's contract endpoints implemented via the Contract trait implementation.

The service binary should use the service! macro to export the application's service endpoints implemented via the Service trait implementation.


The examples directory contains some example applications.


See the CONTRIBUTING file for how to help out.


This project is available under the terms of the Apache 2.0 license.


~1M SLoC