Prototype Rust SDK for the Trust Spanning Protocol
This project is in its initial state. Development is ongoing and interfaces or structure of the repository are likely to change. Nothing in this repository at this moment represents a "final design" or to be overriding the Trust Spanning Protocol specification, or indicating a future direction of the Trust Spanning Protocol.
In short, it is not the reference implementation yet.
You will need to install the most recent Rust compiler, by following the these instructions.
Then, you can use these commands to check out and test the repository:
git clone https://github.com/openwallet-foundation-labs/tsp.git
cd tsp/tsp_sdk
cargo testIf you want to test the language bindings for Python and JavaScript as well, you can run cargo test in the top level
directory of this repository. Please be aware that this requires a working Python installation on your system.
To build the documentation, run:
cargo doc --workspace --no-depsApart from the library, there are a few example executables. The CLI is most useful, see below how to install and use the CLI.
At this point in time, this repository is organized using Cargo workspaces. The workspace contains five crates, the TSP SDK crate, an examples crate, bindings for Python and JavaScript, and one for fuzzing.
The code is organized in various directories:
examples/contains example programstsp_pythoncontains the Python bindingstsp_javascriptcontains the JavaScript bindingstsp_sdk/contains the TSP library, the source code is divided in the following modules / folders:cesr/provides minimalist CESR encoding/decoding support that is sufficient for generating and parsing TSP messages; to keep complexity to a minimum, we explicitly do not provide a full CESR decoder/encoder.crypto/contains the cryptographic core:- generating non-confidential messages signed using Ed25519
- generating confidential messages encrypted using HPKE-Auth; using DHKEM(X25519, HKDF-SHA256) as asymmetric primitives and ChaCha20/Poly1305 as underlying AEAD encrypting scheme, and signed using Ed25519 to achieve non-repudiation (more precisely "strong receiver-unforgeability under chosen ciphertext" or RUF-CTXT or Insider-Auth).
definitions/defines several common data structures, traits and error types that are used throughout the project.transport/code (built using tokio foundations) for actually sending and receiving data over a transport layer.vid/contains code for handling verified identifiers and identities. Currently,did:peer,did:webanddid:webvhare supported.
Documentation on TSP and how to use our example projects (CLI / web interface) can be found on https://docs.teaspoon.world.
The development documentation is available at docs.rs.
The examples crate contains a test CLI interface for this library.
Install it by running the following command in the project root:
cargo install --path examples/ --bin tspTo create an identity:
tsp create --type web --alias bob bobTo verify a VID:
tsp verify --alias alice did:web:raw.githubusercontent.com:openwallet-foundation-labs:tsp:main:examples:test:aliceSee https://docs.teaspoon.world for the full documentation.
See the documentation on how to implement custom VIDs.
See the documentation on how to create / set up an intermediary server.
See the documentation for the technical specification.