Crate zks_proto

Crate zks_proto 

Source
Expand description

§zks_proto

Protocol layer for ZK Protocol - handshake and URL parsing.

This crate provides high-level protocol functionality:

  • 3-Message Handshake: Post-quantum secure key exchange
  • URL Parsing: Support for zk:// (direct) and zks:// (swarm) URLs
  • Protocol Messages: Structured message types for ZK Protocol

§Example

use zks_proto::{ZkUrl, Handshake, ProtocolMode};
 
// Parse a ZK Protocol URL
let url = ZkUrl::parse("zks://peer.example.com:8080")?;
assert_eq!(url.mode(), ProtocolMode::Swarm);
 
// Create a handshake initiator (with trusted responder public key)
let trusted_key = vec![0u8; 1952]; // Example trusted key
let handshake = Handshake::new_initiator("test-room".to_string(), trusted_key);

Re-exports§

pub use error::ProtoError;
pub use error::Result;
pub use handshake::Handshake;
pub use handshake::HandshakeState;
pub use handshake::HandshakeRole;
pub use url::ZkUrl;
pub use url::ProtocolMode;
pub use url::UrlScheme;
pub use messages::ProtocolMessage;
pub use messages::MessageType;

Modules§

error
Error types for zks_proto crate
handshake
3-Message handshake implementation for ZK Protocol
messages
Protocol messages for ZK Protocol
url
URL parsing for ZK Protocol URLs