Skip to content

Commit ffa155e

Browse files
kanzurejonasschnelli
authored andcommitted
peer authentication bip draft editing
1 parent 5e49486 commit ffa155e

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

bip-0150.mediawiki

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99

1010
== Abstract ==
1111

12-
This BIP describes a way how peers can authenticate – without opening fingerprinting possibilities – to other peers to guarantee ownership and/or allowing to access additional or limited services.
12+
This BIP describes a way for peers to authenticate to other peers to guarantee node ownership and/or allow peers to access additional or limited node services, without the possibility of fingerprinting.
1313

1414
== Motivation ==
1515

16-
We assume peer operators want to limit the access of different services or increase datastream priorities to a selective subset of peers. Also we assume peers want to connect to specific peers to broadcast or filter transactions (or similar action that reveals sensitive informations) and therefore they want to authenticate the remote peer and make sure that they have not connected to a MITM.
16+
We assume peer operators want to limit the access of different node services or increase datastream priorities to a selective subset of peers. Also we assume that peers want to connect to specific peers to broadcast or filter transactions (or similar actions that reveal sensitive informations) and therefore operators want to authenticate the remote peer and ensure that they have not connected to a MITM (man-in-the-middle) attacker.
1717

18-
Benefits with peer authentication:
19-
* Peers could detect MITM attacks when connecting to known peers
20-
* Peers could allow resource hungry transaction filtering only to specific peers
21-
* Peers could allow access to sensitive information that can lead to node fingerprinting (fee estimation)
22-
* Peers could allow custom message types (private extensions) to authenticated peers
18+
Benefits of peer authentication:
19+
* Peers can detect MITM attacks when connecting to known peers
20+
* Peers can allow resource hungry transaction filtering only to specific peers
21+
* Peers can allow access to sensitive information that can lead to node fingerprinting (fee estimation)
22+
* Peers can allow custom message types (private extensions) to authenticated peers
2323
24-
A simple authentication scheme based on elliptic cryptography will allow peers to identify each other and selective allow access to restricted services or reject the connection if the identity could not be verified.
24+
A simple authentication scheme based on elliptic cryptography will allow peers to identify each other and selectively allow access to restricted services or reject the connection if the peer identity cannot be verified.
2525

2626
== Specification ==
2727

@@ -31,35 +31,35 @@ The authentication scheme proposed in this BIP uses ECDSA, '''secrets will never
3131

3232
The '''encryption-session-ID''' is available once channels are encrypted (according to BIP-151 [1]).
3333

34-
The identity-public-keys used for the authentication must be pre-shared over a different channel (Mail/PGP, physical paper exchange, etc.). This BIP does not cover a "trust on first use" (TOFU) concept.
34+
The identity-public-keys used for the authentication must be pre-shared over a different channel (mail/PGP, physical paper exchange, etc.). This BIP does not cover a "trust on first use" (TOFU) concept.
3535

3636
The authentication state must be kept until the encryption/connection terminates.
3737

38-
Only one authentication process is allowed per connection. Re-authenticate require re-establishing the connection.
38+
Only one authentication process is allowed per connection. Re-authentication require re-establishing the connection.
3939

4040
=== Known-peers and authorized-peers database ===
41-
Each peer that supports p2p authentication must provide two users editable "databases"
41+
Each peer that supports p2p authentication must provide two user-editable "databases".
4242

4343
# '''known-peers''' contains known identity-public-keys together with a network identifier (IP & port), similar to the "known-host" file supported by openssh.
4444
# '''authorized-peers''' contains authorized identity-public-keys
4545
4646
=== Local identity key management ===
47-
Each peer can configure multiple identity-keys (ECC, 32 bytes). Peers should make sure, each network interface (IPv4, IPv6, tor) has its own identity-key (otherwise it would be possible to link a tor address to a IPvX address).
47+
Each peer can configure multiple identity-keys (ECC, 32 bytes). Peers should make sure that each network interface (IPv4, IPv6, tor) has its own identity-key (otherwise it would be possible to link a tor address to a IPvX address).
4848
The identity-public-key(s) can be shared over a different channel with other node-operators (or non-validating clients) to grant authorized access.
4949

5050
=== Authentication procedure ===
51-
Authentication after this BIP will require both sides to authenticate. Signatures/public-keys will only be revealed if the remote peer could prove that they already know the remote identity-public-key.
51+
Authentication based on this BIP will require both sides to authenticate. Signatures/public-keys will only be revealed if the remote peer can prove that they already know the remote identity-public-key.
5252

5353
# -> Requesting peer sends <code>AUTHCHALLENGE</code> (hash)
5454
# <- Responding peer sends <code>AUTHREPLY</code> (signature)
5555
# -> Requesting peer sends <code>AUTHPROPOSE</code> (hash)
5656
# <- Responding peer sends <code>AUTHCHALLENGE</code> (hash)
5757
# -> Requesting peer sends <code>AUTHREPLY</code> (signature)
5858
59-
For privacy reasons, dropping the connection or aborting during the authentication process must not be possible.
59+
For privacy reasons, dropping the connection or aborting during the authentication process must not be allowed.
6060

6161
=== <code>AUTHCHALLENGE</code> message ===
62-
A peer can send an authentication challenge to see if the responding peer can produce a valid signature with the expected responding peers identity-public-key by sending an <code>AUTHCHALLENGE</code>-message to the remote peer.
62+
A peer can send an authentication challenge to see if the responding peer can produce a valid signature with the expected responding peer's identity-public-key by sending an <code>AUTHCHALLENGE</code>-message to the remote peer.
6363

6464
The responding peer needs to check if the hash matches the hash calculated with his own local identity-public-key. Fingerprinting the requesting peer is not possible.
6565

@@ -81,9 +81,9 @@ A peer must reply an <code>AUTHCHALLENGE</code>-message with an <code>AUTHREPLY<
8181
| 64bytes || signature || normalized comp.-signature || A signature of the encryption-session-ID done with the identity-key
8282
|}
8383

84-
If the challenge-hash from the <code>AUTHCHALLENGE</code>-message did not match the local authentication public-key, the signature must contain 64bytes of zeros.
84+
If the challenge-hash from the <code>AUTHCHALLENGE</code>-message did not match the local authentication public-key, the signature must contain 64 bytes of zeros.
8585

86-
The requesting peer can check the responding peers identity by checking the validity of the sent signature against with the pre-shared remote peers identity-public-key.
86+
The requesting peer can check the responding peer's identity by checking the validity of the sent signature against with the pre-shared remote peers identity-public-key.
8787

8888
If the signature was invalid, the requesting peer must still proceed with the authentication by sending an <code>AUTHPROPOSE</code>-message with 32 random bytes.
8989

@@ -92,7 +92,7 @@ A peer can propose authentication of the channel by sending an <code>AUTHPROPOSE
9292

9393
If the signature sent in <code>AUTHREPLY</code> was invalid, the peer must still send an <code>AUTHPROPOSE</code>-message containing 32 random bytes.
9494

95-
The <code>AUTHPROPOSE</code> message must be answered with an <code>AUTHCHALLENGE</code>-message even if the proposed requesting-peers identity-public-key has not been found in the authorized_peers database. In case of no match, the responding <code>AUTHCHALLENGE</code>-message must contains 32 bytes of zeros.
95+
The <code>AUTHPROPOSE</code> message must be answered with an <code>AUTHCHALLENGE</code>-message - even if the proposed requesting-peers identity-public-key has not been found in the authorized-peers database. In case of no match, the responding <code>AUTHCHALLENGE</code>-message must contains 32 bytes of zeros.
9696

9797
{|class="wikitable"
9898
! Field Size !! Description !! Data type !! Comments
@@ -102,15 +102,15 @@ The <code>AUTHPROPOSE</code> message must be answered with an <code>AUTHCHALLENG
102102

103103
== Post-Authentication Re-Keying ==
104104

105-
After the second <code>AUTHREPLY</code> message (requesting peers signature -> responding peer), both clients must re-key the symmetric encryption according to BIP151 while using '''a slightly different re-key key derivation hash'''.
105+
After the second <code>AUTHREPLY</code> message (requesting peer's signature -> responding peer), both clients must re-key the symmetric encryption according to BIP151 while using '''a slightly different re-key key derivation hash'''.
106106

107-
They both re-key with <code>hash(encryption-session-ID || old_symmetric_cipher_key || requesting-peer-identity-public-key || responding-peer-identity-public-key)</code>
107+
Both peers re-key with <code>hash(encryption-session-ID || old_symmetric_cipher_key || requesting-peer-identity-public-key || responding-peer-identity-public-key)</code>
108108

109109
== Identity-Addresses ==
110110
The peers should display/log the identity-public-key as an identity-address to the users, which is a base58-check encoded ripemd160(sha256) hash. The purpose of this is for better visual comparison (logs, accept-dialogs).
111111
The base58check identity byte is <code>0x0F</code> followed by an identity-address version number (=<code>0xFF01</code>).
112112

113-
An identity address would look like <code>TfG4ScDgysrSpodWD4Re5UtXmcLbY5CiUHA</code> and can be interpreted as a remote peers fingerprint.
113+
An identity address would look like <code>TfG4ScDgysrSpodWD4Re5UtXmcLbY5CiUHA</code> and can be interpreted as a remote peer's fingerprint.
114114

115115
== Compatibility ==
116116

@@ -120,7 +120,7 @@ This proposal is backward compatible. Non-supporting peers will ignore the new <
120120

121121
Before authentication (once during peer setup or upgrade)
122122
# Requesting peer and responding peer create each an identity-keypair (standard ECC priv/pubkey)
123-
# Requesting and responding peer share the identity-public-key over a different channel (PGP mail, physical exchange, etc.)
123+
# Requesting and responding peer share the identity-public-key over a different channel (mail/PGP, physical paper exchange, etc.)
124124
# Responding peer stores requesting peers identity-public-key in its authorized-peers database (A)
125125
# Requesting peer stores responding peers identity-public-key in its known-peers database together with its IP and port (B)
126126
@@ -158,7 +158,7 @@ Authentication
158158
159159
== Disadvantages ==
160160

161-
The protocol may be slow if a peer has a large authorized-peers database due to the requirement of iterating and hashing over all available authorized peers identity-public-keys.
161+
The protocol may be slow if a peer has a large authorized-peers database due to the requirement of iterating and hashing over all available authorized peer identity-public-keys.
162162

163163
== Reference implementation ==
164164

@@ -168,6 +168,7 @@ The protocol may be slow if a peer has a large authorized-peers database due to
168168
169169
== Acknowledgements ==
170170
* Gregory Maxwell and Pieter Wuille for most of the ideas in this BIP.
171+
* Bryan Bishop for editing.
171172
172173
== Copyright ==
173174
This work is placed in the public domain.

0 commit comments

Comments
 (0)