• Stars
    star
    426
  • Rank 101,884 (Top 3 %)
  • Language
    Rust
  • License
    GNU General Publi...
  • Created almost 4 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reference implementation of the Anoma protocols in Rust.

NOTE: This repository is currently being reworked. Instead, please visit the following locations, depending on your interest:


License: GPL v3 Drone CI build status

Overview

Anoma is an intent-centric, privacy-preserving protocol for decentralized counterparty discovery, solving, and multi-chain atomic settlement. To learn more about Anoma's vision, take a look at the Anoma Vision Paper.

This is an implementation of the Anoma protocol in Rust.

Warning

Here lay dragons: this codebase is still experimental, try at your own risk!

💾 Installing

There is a single command to build and install Anoma executables from source (the node, the client and the wallet). This command will also verify that a compatible version of Tendermint is available and if not, attempt to install it. Note that currently at least 16GB RAM is needed to build from source.

make install

After installation, the main anoma executable will be available on path.

To find how to use it, check out the User Guide section of the docs.

If you have Nix, you may opt to build and install Anoma using Nix. The Nix integration also takes care of making a compatible version of Tendermint available.

# Nix 2.4 and later
nix profile install

# All versions of Nix
nix-env -f . -iA anoma

For more detailed instructions and more install options, see the Install section of the User Guide.

⚙️ Development

# Build the provided validity predicate, transaction and matchmaker wasm modules
make build-wasm-scripts-docker

# Development (debug) build Anoma, which includes a validator and some default 
# accounts, whose keys and addresses are available in the wallet
ANOMA_DEV=true make

Using Nix

You may opt to get all of the dependencies to develop Anoma by entering the development shell:

# Nix 2.4 and above
nix develop

# All versions of Nix
nix-shell

Inside the shell, all of the make targets work as usual:

# Build the WASM modules without docker
make build-wasm-scripts

# Development build (uses cargo)
ANOMA_DEV=true make

It is also possible to use the Nix Rust infrastructure instead of Cargo to build the project crates. This method uses crate2nix to derive Nix expressions from Cargo.toml and Cargo.lock files. The workspace members are exposed as packages in flake.nix with a rust_ prefix. Variants where the ABCI-plus-plus feature flag is enabled are exposed with a :ABCI-plus-plus suffix.

# List all packages
nix flake show

# Build the `anoma_apps` crate with `ABCI-plus-plus` feature
nix build .#rust_anoma_apps:ABCI-plus-plus

# Build the (default) anoma package. It consists of wrappers for the Anoma
# binaries (`rust_anoma_apps`) that ensure `tendermint` is in `PATH`.
nix build .#anoma

Advantages:

  • Excellent build reproducibility (all dependencies pinned).
  • Individual crates are stored as Nix derivations and therefore cached in the Nix store.
  • Makes it possible to build Nix derivations of the binaries. Cargo build doesn't work in the Nix build environment because network access is not allowed, meaning that Cargo can't fetch dependencies; cargo vendor could be used to prefetch everything for Cargo, but cargo vendor does not work on our project at the moment.

Disadvantages:

  • Only works for Linux and Darwin targets. WASM builds in particular are not possible with this method. Although, while crate2nix doesn't support targeting WASM, we should be able to build the WASM modules via Cargo - if only cargo vendor worked.

Note: If you have modified the Cargo dependencies (changed Cargo.lock), it is necessary to recreate the Cargo.nix expressions with crate2nix. Helpers are provided as flake apps (Nix 2.4 and later):

nix run .#generateCargoNix
nix run .#generateCargoNixABCI-plus-plus

Before submitting a PR, pls make sure to run the following

# Format the code
make fmt

# Lint the code
make clippy

🧾 Logging

To change the log level, set ANOMA_LOG environment variable to one of:

  • error
  • warn
  • info
  • debug
  • trace

The default is set to info for all the modules, expect for Tendermint ABCI, which has a lot of debug logging.

For more fine-grained logging levels settings, please refer to the tracing subscriber docs for more information.

To switch on logging in tests that use #[test] macro from test_log::test, use RUST_LOG with e.g. RUST_LOG=info cargo test -- --nocapture.

How to contribute

Please see the contributing page.

Dependencies

The ledger currently requires that Tendermint version 0.34.x is installed and available on path. The pre-built binaries and the source for 0.34.8 are here, also directly available in some package managers.

This can be installed by make install command (which runs scripts/install/get_tendermint.sh script).

More Repositories

1

namada

Rust implementation of Namada, a Proof-of-Stake L1 for interchain asset-agnostic privacy
Rust
2,394
star
2

juvix

A language for intent-centric and declarative decentralised applications
Haskell
447
star
3

namada-testnets

Testnet configurations and coordination for the Namada network.
327
star
4

namada-trusted-setup-claimer

Sign arbitrary messages with keys obtained from Namada's trusted setup
Rust
320
star
5

vamp-ir

Vamp-IR is a proof-system-agnostic language for writing arithmetic circuits
Rust
155
star
6

taiga

A framework for generalized shielded state transitions
Rust
134
star
7

zkp-compiler-shootout

Evaluating & benchmarking ZKP compilation strategies.
Rust
118
star
8

masp

The multi-asset shielded pool (MASP) provides a unified privacy set for all assets on Namada.
Rust
88
star
9

ferveo

An implementation of a DKG protocol for front-running protection on Anoma.
Rust
78
star
10

namada-interface

TypeScript
77
star
11

whitepaper

TeX
59
star
12

namada-docs

MDX
48
star
13

namada-shielded-expedition

Python
42
star
14

typhon

Formalization of Typhon protocol
TLA
28
star
15

geb

A Categorical View of Computation
Idris
28
star
16

research

Early-stage research related to the Anoma protocols.
Idris
23
star
17

specs

Specifications for the Anoma protocols.
TeX
23
star
18

alucard

A common lisp DSL for writing zero knowledge circuits
Common Lisp
18
star
19

namada-indexer

Namada indexer to be used in conjunction with the namada interface
Rust
16
star
20

ethereum-bridge

A generalized fully trustless Ethereum bridge for sovereign chains.
Solidity
12
star
21

minijuvix

Haskell
11
star
22

juvix-stdlib

The Juvix standard library
Makefile
9
star
23

VampIR-Book

A book which can act as an introduction and documentation for VampIR
CSS
9
star
24

masp-mpc

MASP MPC code
Rust
8
star
25

namada-mainnet-genesis

Python
7
star
26

namada-sdk-starter

Rust
6
star
27

juvix-nightly-builds

6
star
28

abstract-resource-machine-simulator

Makefile
6
star
29

anoma-alpha

An intent-centric, privacy-preserving protocol for decentralized counterparty discovery, solving, and multi-chain atomic settlement.
Rust
6
star
30

juvix-e2e-demo

Juvix compiler stack - Integration demo
Dockerfile
6
star
31

exhibit_plonkup

Rust
5
star
32

devtool

Rust
4
star
33

anoma-blog

Jupyter Notebook
4
star
34

verify-beacon

Rust
3
star
35

vscode-juvix

VSCode extension for Juvix
TypeScript
3
star
36

dev-utils

Shell
3
star
37

namada-whitepaper

Namada whitepaper
3
star
38

juvix-docs

Juvix Official Documentation
Makefile
3
star
39

devchain-container

Shell
2
star
40

intents-snippets

A repo to put code snippets related to intent research
Agda
2
star
41

Isabelle-HPaxos

A formalization of HPaxos in Isabelle
Isabelle
2
star
42

typhon-sml

Typhon reference implementation in Standard ML
Standard ML
2
star
43

namada-genesis

Python
2
star
44

namada-masp-indexer

The Namada Masp Indexer reference implementation.
Rust
2
star
45

anoma-wasm-multitoken

Validity predicate and transactions for a variable supply multitoken account
Rust
2
star
46

wasm-workspace

Rust
2
star
47

namada-shielded-airdrop

Rust
2
star
48

anoma-blog-writing-guide

Comprehensive guide to writing blogposts for the anoma blog.
2
star
49

juvix-quickcheck

Property-based testing for Juvix
Makefile
2
star
50

plonkup-hash

A collection of hash gadgets written for Plonkup
Rust
1
star
51

juvix-mode

The Juvix Emacs mode
Emacs Lisp
1
star
52

vscode-vampir

1
star
53

anoma-app-lib

A library for intent-centric application development.
1
star
54

juvix-test

A testing framework for Juvix
Shell
1
star
55

juvix-anoma-test

A library for testing Anoma applications
1
star
56

juvix-containers

Immutable container types for Juvix
Makefile
1
star
57

highlightjs-juvix

Juvix language grammars for highlightjs (low maintenance)
JavaScript
1
star
58

art-template

Anoma Research Topics Template
TeX
1
star
59

juvix-anoma-stdlib

A Juvix library for writing Anoma applications
Makefile
1
star
60

namada-light-sdk-starter

Namada light sdk starter kit
Dockerfile
1
star
61

ART-2023-Gureev-Cubides-Geb-Pipeline

TeX
1
star