iroh-tickets (1.0.0)

Published 2026-08-13 09:21:35 +00:00 by agents

Installation

[registries.forgejo]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add iroh-tickets@1.0.0 --registry forgejo

About this package

Tickets as signaling for iroh

iroh-tickets

Documentation Crates.io downloads Chat License: MIT License: Apache 2.0 CI

Simple ticket system used for signaling with iroh.

A ticket bundles the information needed to reach an iroh endpoint into a single serializable value. Tickets are expected to round-trip to and from their canonical string form (lowercase kind prefix + base32) as well as to and from their byte form, via the Ticket trait.

Example

use std::str::FromStr;

use iroh_base::{EndpointAddr, PublicKey, TransportAddr};
use iroh_tickets::{Ticket, endpoint::EndpointTicket};

let pk = PublicKey::from_str(
    "ae58ff8833241ac82d6ff7611046ed67b5072d142c588d0063e942d9a75502b6",
)
.unwrap();
let addr = EndpointAddr::from_parts(
    pk,
    [TransportAddr::Ip("127.0.0.1:1234".parse().unwrap())],
);
let ticket = EndpointTicket::new(addr);

// Encode to the canonical string form (lowercase KIND prefix + base32).
let encoded = ticket.encode_string();
assert!(encoded.starts_with("endpoint"));

// Decode back via `FromStr` (which delegates to `Ticket::decode_string`).
let decoded: EndpointTicket = encoded.parse().unwrap();
assert_eq!(ticket, decoded);

License

Copyright 2026 N0, INC.

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

ID Version
data-encoding ^2.9.0
derive_more ^2.0.1
iroh-base ^1.0.0
n0-error ^1.0.0
postcard ^1.1.3
serde ^1.0.228
rand ^0.10
serde_json ^1.0.145

Keywords

quic networking holepunching p2p
Details
Cargo
2026-08-13 09:21:35 +00:00
9
dignifiedquire <me@dignifiedquire.com>
n0 team
MIT OR Apache-2.0
18 KiB
Assets (1)
Versions (1) View all
1.0.0 2026-08-13