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 Jan 16, 2024
1 parent 224008d commit fe90471
Show file tree
Hide file tree
Showing 6 changed files with 539 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
resolver = "2"

members = [
"lightning",
"lightning-block-sync",
"lightning-invoice",
"lightning-net-tokio",
"lightning-persister",
"lightning-background-processor",
"lightning-rapid-gossip-sync",
"lightning-custom-message",
"lightning",
"lightning-block-sync",
"lightning-invoice",
"lightning-net-tokio",
"lightning-persister",
"lightning-background-processor",
"lightning-rapid-gossip-sync",
"lightning-custom-message",
"mutual-message-exchange",
]

exclude = [
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 fe90471

Please sign in to comment.