Expand description
TLSNotary protocol implementation.
This crate provides the core protocol for generating and verifying proofs of TLS sessions. A prover can demonstrate to a verifier that specific data was exchanged with a TLS server, without revealing the full transcript.
§Overview
The protocol involves two parties:
- Prover (
Prover): connects to a TLS server and generates proofs about the session. - Verifier (
Verifier): collaborates with the prover during the TLS session and verifies the resulting proofs.
Both parties communicate through an established Session.
§Workflow
The protocol has two main phases:
Commitment: The prover and verifier collaborate to construct a TLS transcript commitment from the prover’s communication with a TLS server. This authenticates the transcript for the verifier, without the verifier learning the contents.
Selective Disclosure: The prover selectively reveals portions of the committed transcript to the verifier, proving statements about the data exchanged with the server.
§Steps
- Establish a communication channel between prover and verifier.
- Create a
Sessionon each side from the channel. - Create a
ProverorVerifier. - Run the commitment phase: the prover connects to the TLS server and exchanges data to obtain a commitment to the TLS transcript.
- (Optional) Perform selective disclosure: the prover provably reveals selected data to the verifier.
§Performance
The MPC-TLS protocol is highly interactive: prover and verifier exchange many small messages, and each one is on the critical path. On such traffic, Nagle’s algorithm — enabled by default on TCP sockets — coalesces small writes and waits for outstanding ACKs before sending, adding a round-trip’s worth of delay to each exchange and significantly slowing the protocol.
For this reason you should disable Nagle’s algorithm by enabling
TCP_NODELAY on every TCP socket you hand to this crate, namely:
- the prover ↔ verifier channel passed to
Session::new; - the connection to the TLS server passed to
Prover::connect(MPC mode); - the connection to the TLS server passed to
Verifier::run(proxy mode).
With tokio this is done via
TcpStream::set_nodelay:
let socket = tokio::net::TcpStream::connect(addr).await?;
socket.set_nodelay(true)?;This setting has no effect on non-TCP transports (e.g. WebSocket relays or in-memory duplex streams).
Re-exports§
pub use rangeset;pub use tlsn_attestation as attestation;
Modules§
- config
- Configuration types.
- connection
- TLS connection types.
- hash
- Hash types.
- prover
- Prover.
- transcript
- Transcript types.
- verifier
- Verifier.
- webpki
- Web PKI types.
Structs§
- Error
- TLSNotary error.
- Mpc
- MPC-TLS commitment protocol.
- Proxy
- Proxy-TLS commitment protocol.
- Session
- A TLSNotary session over a communication channel.
- Session
Driver - The polling half of a split session.
- Session
Handle - The control half of a split session.
- Stream
- A multiplexed stream.
Traits§
- Protocol
Config - Protocol variant.
Type Aliases§
- Result
- Result type.