bolt8

Encrypted and authenticated transport, per BOLT #8 (docs.ppad.tech/bolt8).
git clone git://git.ppad.tech/bolt8.git
Log | Files | Refs | README | LICENSE

commit 7c3372ebf0144a246cfbedcb3e71a4bb010dc21e
parent 13eaef80bd6998ee9dac6475687c364847d5240c
Author: Jared Tobin <jared@jtobin.io>
Date:   Sat, 10 Oct 2026 13:39:19 +0400

meta: version 0.1.0

Diffstat:
MCHANGELOG | 33+++++++++++++++++++++++++++++++++
Mppad-bolt8.cabal | 10++++++----
2 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG @@ -0,0 +1,33 @@ +# Changelog + +- 0.1.0 (UNRELEASED) + * Breaking: splits the post-handshake session into separate Sender + and Receiver states, so one state can't serve both directions and + a reader thread and a writer thread can each own one. Every + operation returns the next state; the docs now stress that reusing + an old state reuses a nonce (or accepts replays). + + * Breaking: the local static key is a Keypair, so its secret and + public halves can't be mismatched, and the handshake states are + distinct Initiator and Responder types. + + * Breaking: frames are decrypted whole with 'decrypt', or on a + stream with 'decrypt_header' (exactly 18 bytes) followed by + 'decrypt_body'. 'decrypt_frame', 'decrypt_frame_partial' and + FrameResult are removed. + + * Breaking: removes unused API (Key32, SessionNonce, MessagePayload, + HandshakeState, the public Sec type, the DecryptionFailed error) + and the exposed Internal module, renames the InvalidKey error to + InvalidEntropy, and drops the Generic, Show and Eq instances of + secret-bearing types. All public types have NFData instances. + + * Fixes the key rotation docs (keys rotate every 500 messages in each + direction), rotates keys whenever a nonce reaches 1000 or more, and + requires ppad-aead >= 0.3.6 for constant-time MAC comparison. + + * Tests now cover every BOLT #8 Appendix A vector, including all + handshake failure cases and the final keys on both sides. + +- 0.0.1 (2026-04-18) + * Initial release. diff --git a/ppad-bolt8.cabal b/ppad-bolt8.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: ppad-bolt8 -version: 0.0.1 +version: 0.1.0 synopsis: Encrypted and authenticated transport per BOLT #8 license: MIT license-file: LICENSE @@ -8,11 +8,13 @@ author: Jared Tobin maintainer: jared@ppad.tech category: Cryptography build-type: Simple -tested-with: GHC == 9.10.3 +tested-with: GHC == { 9.10.3 } extra-doc-files: CHANGELOG description: - Encrypted and authenticated transport, per - [BOLT #8](https://github.com/lightning/bolts/blob/master/08-transport.md). + Encrypted and authenticated transport for the Lightning Network, per + [BOLT #8](https://github.com/lightning/bolts/blob/master/08-transport.md): + the Noise_XK_secp256k1_ChaChaPoly_SHA256 handshake and message + transport with key rotation. source-repository head type: git