Crate penumbra_proto

source ·
Expand description

Protobuf definitions for Penumbra.o

This crate only contains the .proto files and the Rust types generated from them. These types only handle parsing the wire format; validation should be performed by converting them into an appropriate domain type, as in the following diagram:

┌───────┐          ┌──────────────┐               ┌──────────────┐
│encoded│ protobuf │penumbra_proto│ TryFrom/Into  │ domain types │
│ bytes │<──wire ─>│    types     │<─validation ─>│(other crates)│
└───────┘  format  └──────────────┘   boundary    └──────────────┘

The DomainType marker trait can be implemented on a domain type to ensure these conversions exist.



  • Helper methods used for shaping the JSON (and other Serde) formats derived from the protos. TODO: Extract the Bech32 prefixes into a module at the root of the crate, and then remove this module entirely. We don’t want to be custom-shaping serde formats, we want to have those match protobuf JSON exactly.



  • A marker type that captures the relationships between a domain type (Self) and a protobuf type (Self::Proto).
  • A Protocol Buffers message.
  • A type that can be encoded to a protobuf Any message.

Derive Macros