Skip to content

Commit

Permalink
Add an implementation of mutual message exchange
Browse files Browse the repository at this point in the history
This adds a new crate, `mutual-message-exchange` which allows two
parties to maintain a list of keys with which they want to exchange
messages and exchange one message at the cost of an extra
half-round-trip.

This is anticipated for use in BOLT12, where extra data can be
included in a BOLT12 `Invoice` which allows a mutually-trusting
sender to include a message in the onion, while any
non-mutually-trusting entities will not learn anything about the
recipient (subject to the use of blinded paths).

A full write-up of this protocol is available as
[bLIP 31](lightning/blips#31).
  • Loading branch information
TheBlueMatt committed Oct 2, 2024
1 parent 563c017 commit fbf88f1
Show file tree
Hide file tree
Showing 7 changed files with 575 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ members = [
"lightning-rapid-gossip-sync",
"lightning-custom-message",
"lightning-transaction-sync",
"mutual-message-exchange",
"possiblyrandom",
]

Expand Down
1 change: 1 addition & 0 deletions ci/ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ WORKSPACE_MEMBERS=(
lightning-rapid-gossip-sync
lightning-custom-message
lightning-transaction-sync
mutual-message-exchange
possiblyrandom
)

Expand Down
21 changes: 21 additions & 0 deletions mutual-message-exchange/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "mutual-message-exchange"
version = "0.1.0"
authors = ["Matt Corallo"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = """
An implementation of a trivial mutual authentication scheme where a message can be exchanged iff two parties mutually trust each other (out of individual trusted-keys lists).
"""
edition = "2021"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]

[features]

[dependencies]
bitcoin_hashes = { version = "^0.12.0", default-features = false }
secp256k1 = { version = "^0.27.0", default-features = false, features = ["alloc"] }

[dev-dependencies]
1 change: 1 addition & 0 deletions mutual-message-exchange/src/chacha20.rs
1 change: 1 addition & 0 deletions mutual-message-exchange/src/chacha20poly1305rfc.rs
Loading

0 comments on commit fbf88f1

Please sign in to comment.