From 2650f638650a566c95596eb51e110a2912094a48 Mon Sep 17 00:00:00 2001 From: themighty1 Date: Fri, 18 Aug 2023 16:48:14 +0300 Subject: [PATCH] add a quick start guide --- src/SUMMARY.md | 10 +++--- src/developers/quick_start.md | 66 +++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 src/developers/quick_start.md diff --git a/src/SUMMARY.md b/src/SUMMARY.md index e789ed3..f2c23b8 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -1,6 +1,8 @@ # Summary -[Introduction](./intro.md) +- [Introduction](./intro.md) + +- [Quick Start](./developers/quick_start.md) # Protocol @@ -29,9 +31,7 @@ - [Committed Oblivious Transfer](./mpc/committed_ot.md) - [Oblivious Transfer](./mpc/oblivious_transfer.md) +# Developer resources -# Specification -- [Notarized session](./spec/notarized_session.md) - -+[Glossary](./glossary.md) \ No newline at end of file ++[Glossary](./glossary.md) diff --git a/src/developers/quick_start.md b/src/developers/quick_start.md new file mode 100644 index 0000000..053f1b8 --- /dev/null +++ b/src/developers/quick_start.md @@ -0,0 +1,66 @@ +This guide will take you through the steps of: +- starting a `Notary` server +- running a `Prover` to notarize some web data +- running a `Verifier` to verify the notarized data + +Note that the TLSNotary protocol assumes that the `Notary` is trusted by the `Verifier`. To minimize the trust, the `Verifier` itself can act as a `Notary`. + +# Preliminaries + +### Install rust + +If you don't have `rust` installed yet, install it with [rustup](https://rustup.rs/): +```shell +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +``` + +# Guide + +### Start a Notary server: + +```shell +git clone https://github.com/tlsnotary/notary-server +cd notary-server +cargo run --release +``` + +The `Notary` server will now be running in the background waiting for connections from a `Prover`. You can switch to another console to run the `Prover`. + +For more information on how to configure the `Notary` server, please refer to [this](https://github.com/tlsnotary/notary-server#running-the-server). + +### Run a simple Prover: + +```shell +git clone https://github.com/tlsnotary/tlsn +cd tlsn/tlsn/examples +cargo run --release --example simple_prover +``` + +The notarization session usually takes a few moments and the resulting proof will be written to the "proof.json" file. The proof can then be passed on to the `Verifier` for verification. + +The `simple_prover` notarizes and redacts the `USER_AGENT` HTTP header from the proof for the `Verifier`. You can change the code in `tlsn/tlsn/examples/simple_prover.rs` to meet your needs: + +- change which server the `Prover` connects to +- add or remove HTTP request headers +- redact other strings in the request or the response + +⚠️ Please note that by default the `Notary` server expects that the cumulative size of the request and the server response is not more than 16KB. + + +### Run a simple Verifier: + +```shell +cargo run --release --example simple_verifier +``` + +This will verify the proof from the `simple_prover` (`proof.json`) and output the result to the console. + +Note how the parts which the prover chose not to disclose will be shown as "X": +```plaintext +GET / HTTP/1.1 +host: example.com +accept: */* +accept-encoding: identity +connection: close +user-agent: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +``` \ No newline at end of file