Expand description
This Rust crate contains an implementation of the Sphinx packet format for the HOPR protocol.
ยงSPHINX shared keys derivation
The architecture of the SPHINX shared key derivation is done generically, so it can work with any
elliptic curve group for which the CDH problem is hard. The generic Sphinx implementation only
requires one to implement the SphinxSuite trait.
The trait requires having the following building blocks:
- elliptic curve group (
GroupElement) and corresponding the scalar type (Scalar) - type representing public and private keypair and their conversion to
ScalarandGroupElement(by the means of the correspondingFromtrait implementation)
Currently, there are the following SphinxSuite implementations:
Secp256k1Suite: deprecated, used in previous HOPR versionsEd25519Suite: simple implementation using Ed25519, used for testing- X25519Suite currently used, implemented using the Curve25519 Montgomery curve for faster computation
The implementation can be easily extended for different elliptic curves (or even arithmetic multiplicative groups).
In particular, as soon as there is a way to represent Ed448 PeerIDs, it would be easy to create e.g., an
X448Suite.
Modulesยง
- derivation ๐
- Contains simple key derivation functions for different purposes
- ec_
groups ๐ - Implementations of the
SphinxSuitetrait for different elliptic curve groups - errors
- Contains various errors returned from this crate.
- packet ๐
- Contains the main implementation of a SPHINX packet.
- prelude
- routing ๐
- Implementation of the SPHINX header format
- shared_
keys ๐ - Derivation of shared keys for SPHINX header
- surb ๐
- Contains Return Path and SURB-related types