bolt4

Onion routing protocol, per BOLT #4 (docs.ppad.tech/bolt4).
git clone git://git.ppad.tech/bolt4.git
Log | Files | Refs | README | LICENSE

CHANGELOG (2347B)


      1 # Changelog
      2 
      3 - 0.1.1 (2026-10-31)
      4   * Merely bumps the ppad-aead, ppad-fixed, and ppad-secp256k1
      5     dependencies, to 0.3.7, 0.2.1, and 0.5.9.
      6 
      7 - 0.1.0 (2026-10-10)
      8   * A substantial rewrite, with breaking changes throughout:
      9 
     10     * The API is exported from Lightning.Protocol.BOLT4 alone, and uses
     11       snake_case names (e.g. construct, process, construct_error,
     12       create_blinded_path). The Prim, Codec and Internal modules are
     13       no longer exposed.
     14 
     15     * Fundamental types come from ppad-bolt1: points are Points,
     16       amounts are MilliSatoshis, short channel ids and TLV streams are
     17       bolt1's. allowed_features is a ppad-bolt9 FeatureVector. The
     18       private BigSize, TLV and truncated-integer codecs are gone.
     19 
     20     * Secret keys (SecretKey) must be exactly 32 bytes encoding a valid
     21       scalar. Secret keys, shared secrets and payment secrets are
     22       abstract, with redacted Show instances; shared and payment
     23       secrets compare in constant time.
     24 
     25     * process takes the path_key received with an onion, derives the
     26       blinded private key, decrypts encrypted_recipient_data (using
     27       path_key or current_path_key) and returns its contents and the
     28       next path key.
     29 
     30     * Hop payloads and encrypted_data_tlv streams reject unknown even
     31       types and keep unknown odd ones, so re-encoding is exact.
     32       payment_metadata and total_amount_msat are typed fields.
     33 
     34     * Failures are a typed sum of every failure code in the spec, with
     35       an escape hatch for unknown codes; invalid_realm is gone, and
     36       required_channel_feature_missing, unknown_next_peer and
     37       invalid_onion_blinding are new.
     38 
     39     * unwrap_error reports the hop whose HMAC matches even when its
     40       failure message is malformed. wrap_error is total, and
     41       construct_error fails only on an unencodable failure message.
     42 
     43   * Fixes onion construction for routes of three or more hops, the
     44     framing and padding of failure messages, and decoding of payload
     45     lengths past the end of hop_payloads, overlong TLV lengths and
     46     unknown even TLV types.
     47 
     48   * The onion HMAC check is constant time.
     49 
     50   * Tests now cover the onion, error, route blinding and blinded
     51     payment test vectors of BOLT #4, through the public API.
     52 
     53   * Adds NFData instances, and criterion and weigh benchmarks.
     54 
     55 - 0.0.1 (2026-04-18)
     56   * Initial release.