Skip to content

Commit f7982ca

Browse files
committed
add sender authentication
1 parent 0cd3f84 commit f7982ca

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

blip-0002.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ The following table contains extension tlv fields for the `payment_onion_payload
8585

8686
| Type | Name | Link |
8787
|-------------|-----------------------------|--------------------------------|
88+
| 83231 | `sender_auth` | [bLIP 14](./blip-0014.md) |
8889
| 7629169 | `podcasting_2_0` | [bLIP 10](./blip-0010.md) |
8990

9091

blip-0014.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
```
2+
bLIP: 14
3+
Title: Sender authentication
4+
Status: Draft
5+
Author: Joost Jager <[email protected]>
6+
Created: 2022-02-04
7+
License: CC0
8+
```
9+
10+
## Abstract
11+
12+
By default, the lightning protocol protects the sender identity by means of
13+
ephemeral keys and onion routing. There are however use cases that ask for
14+
inclusion of the sender identity with a payment.
15+
16+
This bLIP serves to document a way to authenticate the sender of a payment via a
17+
custom TLV record.
18+
19+
## Copyright
20+
21+
This bLIP is licensed under the CC0 license.
22+
23+
## Specification
24+
25+
Sender:
26+
27+
* MUST include a TLV record keyed by type `83231` with the following value:
28+
29+
* [`33*byte`:`sender_pubkey`]
30+
* [`var length`:`signature`]
31+
32+
`sender_pubkey` is set to the public key of the sender. Note that `sender_pubkey` doesn't
33+
need to be the sender's node public key. It can also be a more general
34+
identity.
35+
36+
`signature` is a DER-encoded ECDSA signature calculated using `sender_pubkey` over the message:
37+
38+
`recipient_pubkey (33 bytes) | payment_hash (32 bytes) | payment_secret (32 bytes) | amount_msat (8 bytes)`
39+
40+
Receiver:
41+
42+
* Verifies that `signature` is produced using `sender_pubkey`.
43+
44+
* If verification fails, SHOULD error with
45+
`PERM|15 incorrect_or_unknown_payment_details`.
46+
47+
## Motivation
48+
49+
There are many ways to authenticate the sender of a payment in Lightning. This
50+
documentation is an attempt prevent the emergence of too many variants that all
51+
do more or less the same thing.
52+
53+
## Rationale
54+
55+
* The TLV record key is an odd number, meaning that the record is ignored by
56+
receivers that do not support sender authentication. No feature bit is needed.
57+
58+
* It is possible to recover the public key from an ECDSA signature, so strictly
59+
speaking `sender_pubkey` is redundant. Note that with Schnorr signatures, recovery is no
60+
longer possible.
61+
62+
* It is undesired that a signature can be reused in any way. Therefore all of
63+
the identifying payment properties are covered by the signature.

0 commit comments

Comments
 (0)