Crate concordium_base

source ·
Expand description

§concordium_base

A library that defines common types and functionality that are needed by Concordium Rust projects. The scope of this library is limited to core definitions that are needed by most users.

Its functionality is meant to be re-exported by higher-level libraries, such as the concordium-rust-sdk.

The library covers the following areas

  • the full implementation of the identity layer cryptography. In particular the data structures, data exchange formats between the different parties, and zero-knowledge proofs are implemented by this library.
  • implementation of encrypted transfers, including data exchange formats and zero-knowledge proofs.
  • implementation of ElGamal encryption over the curve abstraction defined in the library.
  • implementation of bulletproofs over the curve abstraction.
  • definition of transactions supported by Concordium, including their hashing, signing, and serialization.
  • definition of the common serialization formats used by the chain.
  • implementation of the VRF (Verifiable Random Function) used by the consensus protocol.

§Features

The library has no default features and the following optional ones:

  • encryption - additionally exposes the common::encryption module for handling the encryption format used by various Concordium tools (such as wallet exports). This feature is covered by semver guidelines.
  • ffi - enabling this feature adds a number of foreign exports to the library. These are not guaranteed to be stable and are only used when integrating the library into the node.
  • internal-test-helpers - enabling this feature exposes some library internals that are needed in benchmarks. Functionality exposed by this feature has no stability guarantees.

§Guarantees

This library should always be possible to compile for android/ARM, iOS, Wasm, and x86 code. Some parts may be feature gated to work around platform specific limitations though.

§Minimum supported rust version

The minimum supported Rust version is stated in the Cargo.toml manifest. Changes in this minimal supported version are going to be accompanied by at least a minor version increase.

Re-exports§

Modules§

  • Implementation of aggregate signatures specified in https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04
  • Basis type definitions that are used throughout the crate.
  • Implementation of bulletproofs in the scope needed by Concordium.
  • This module contains types and their implementations related to the CIS-2 token standard.
  • Common types and operations used throughout the Concordium chain development.
  • Constants for various core chain operations.
  • Basic definitions of the curve and pairing abstractions, and implementations of these abstractions for the curves used on Concordium.
  • Implementation of the Dodis-Yampolskiy PRF function. This is used when creating credentials to get a random-looking credential registration ID.
  • Implementation of the verifiable random function as specified in https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-vrf-09.
  • We expose the PublicKey, SecretKey, and Signature from the third-party ed25519_dalek crate here because these types appear in Concordium’s API.
  • A few helpers around the dalek ed25519 signature scheme.
  • Implementation of elgamal public key encryption and decryption over a Curve.
  • This library provides the API needed by the chain, the wallet, and the supporting tools to deal with encrypted amounts.
  • Different types of hashes based on SHA256.
  • This module and its submodules implement the Concordium identity layer, providing the core functionality for all entities involved (users, identity providers, and the chain).
  • Implementation of Pedersen commitments over an arbitrary curve.
  • An implementation of the Pointcheval-Sanders signature scheme https://eprint.iacr.org/2015/525
  • This module provides the random oracle replacement function needed in the sigma protocols, bulletproofs, and any other constructions. It is based on SHA3.
  • Implementations of sigma protocols needed by the identity layer of Concordium.
  • Type definitions related to use of smart contracts.
  • Definition of transactions and other transaction-like messages, together with their serialization, signing, and similar auxiliary methods.
  • Definitions and functionality related to chain updates.
  • Functionality related to constructing and verifying Web3ID proofs.