Skip to main content

Rust Quick Start

This quick start demonstrates how to use TLSNotary with Rust code.

Requirements​

Before we start, make sure you have cloned the tlsn repository and have a recent version of Rust installed.

  1. Clone the tlsn repository:
    git clone https://github.com/tlsnotary/tlsn.git --branch v0.1.0-alpha.14
  2. If you don't have Rust installed yet, you can install it using rustup. If your Rust version is outdated, update it with rustup update stable.

Basic Verifier: Verifying Data from an API in Rust​

This example demonstrates how to use TLSNotary in a simple session between a Prover and a Verifier. It involves the Verifier first verifying the MPC-TLS session and then confirming the correctness of the data.

Follow the instructions from: https://github.com/tlsnotary/tlsn/tree/main/crates/examples/basic#readme

Proxy Verifier: Verifying Data Using Proxy Mode​

This example is very similar to the basic verifier, but shows how to set up prover and verifier to use proxy mode for verification.

Follow the instructions from https://github.com/tlsnotary/tlsn/tree/main/crates/examples/proxy#readme

Simple Attestation Example: Attesting and Verifying Data from an API in Rust​

TLSNotary also supports a workflow where a Verifier (acting as Attestor) attests to the proven data. The Prover can then generate a presentation of this attested data, which can be verified by anyone who trusts the Attestor.

Follow the instructions from: https://github.com/tlsnotary/tlsn/tree/main/crates/examples/attestation#readme

Zero-Knowledge Age Verification Example​

This example demonstrates privacy-preserving age verification using TLSNotary and zero-knowledge proofs. It allows a prover to demonstrate they are 18+ years old without revealing their actual birth date or any other personal information. The ZK proof is generated using Noir.

Follow the instructions from: https://github.com/tlsnotary/tlsn/tree/main/crates/examples/basic_zk#readme

🍾 Great job! You have successfully used TLSNotary in Rust.