Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BIP324 Encrypted Transport Protocol
# BIP-324 Encrypted Transport Protocol

[BIP324](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki) describes the V2 encrypted communication protocol for the bitcoin P2P network.
[BIP-324](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki) describes the V2 encrypted communication protocol for the bitcoin P2P network.

## Motivation

Expand All @@ -10,9 +10,9 @@ Bitcoin's original P2P protocol, "V1", was designed without any encryption. Even
* Plaintext message tampering, without detection, is trivial for a man in the middle (MitM) attacker.
* Nefarious actors may associate metadata, such as IP addresses and transaction origins, without explicitly having to connect directly to peers.

BIP 324 - "V2" - encrypted communication protects against the above issues increasing the privacy and censorship-resistance of the bitcoin ecosystem. Any applications communicating with bitcoin nodes, including light clients, should make use of the V2 protocol.
BIP-324 - "V2" - encrypted communication protects against the above issues increasing the privacy and censorship-resistance of the bitcoin ecosystem. Any applications communicating with bitcoin nodes, including light clients, should make use of the V2 protocol.

## Packages

* `protocol` - Exports the `BIP324` client library.
* `protocol` - Exports the `bip324` client library.
* `proxy` - A small side-car application to enable V2 communication for V1-only applications.
2 changes: 1 addition & 1 deletion protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ bitcoin_hashes = { version ="0.15.0", default-features = false }
chacha20-poly1305 = { version = "0.1.1", default-features = false }

[dev-dependencies]
# bitcoind version 26.0 includes support for BIP324's V2 protocol, but it is disabled by default.
# bitcoind version 26.0 includes support for BIP-324's V2 protocol, but it is disabled by default.
bitcoind = { package = "corepc-node", version = "0.7.1", default-features = false, features = ["26_0","download"] }
hex = { package = "hex-conservative", version = "0.2.0" }
2 changes: 1 addition & 1 deletion protocol/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Protocol

A BIP324 library to establish and communicate over an encrypted channel.
A BIP-324 library to establish and communicate over an encrypted channel.

The library is designed with a bare `no_std` and "Sans I/O" interface to keep it as agnostic as possible to application runtimes, but higher level interfaces are exposed for ease of use.

Expand Down
2 changes: 1 addition & 1 deletion protocol/doc/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ With Bob's public key, Alice derives the shared secret and ensures the decrypted

## ChaCha20Poly1305

BIP324 elects to use the ChaCha20Poly1305 Authenticated Encryption with Addition Data (AEAD) algorithm under the hood. This is a combination of the ChaCha20 stream cipher and the Poly1305 message authentication code (MAC). In this context, "authentication" refers to the encrypted message's integrity, not to the identity of either party communicating.
BIP-324 elects to use the ChaCha20Poly1305 Authenticated Encryption with Addition Data (AEAD) algorithm under the hood. This is a combination of the ChaCha20 stream cipher and the Poly1305 message authentication code (MAC). In this context, "authentication" refers to the encrypted message's integrity, not to the identity of either party communicating.

Poly1305 is a purpose-built MAC, as opposed to something like an HMAC using SHA256 which leverages an existing hash scheme to build a message authentication code. Purpose-built introduces new complexity, but also allows for increased performance.
6 changes: 3 additions & 3 deletions protocol/src/fschacha20poly1305.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: CC0-1.0

//! Wrap ciphers with automatic re-keying in order to provide [forward secrecy](https://eprint.iacr.org/2001/035.pdf) within a session.
//! Logic is covered by the BIP324 test vectors.
//! Logic is covered by the BIP-324 test vectors.
//!
//! ## Performance Considerations
//!
Expand Down Expand Up @@ -51,7 +51,7 @@ impl std::error::Error for Error {
/// A wrapper over ChaCha20Poly1305 AEAD stream cipher which handles automatically changing
/// nonces and re-keying, providing forward secrecy within the session.
///
/// FSChaCha20Poly1305 is used for message packets in BIP324.
/// FSChaCha20Poly1305 is used for message packets in BIP-324.
#[derive(Clone)]
pub struct FSChaCha20Poly1305 {
key: Key,
Expand Down Expand Up @@ -138,7 +138,7 @@ impl FSChaCha20Poly1305 {
/// A wrapper over ChaCha20 (unauthenticated) stream cipher which handles automatically changing
/// nonces and re-keying, providing forward secrecy within the session.
///
/// FSChaCha20 is used for lengths in BIP324. Should be noted that the lengths are still
/// FSChaCha20 is used for lengths in BIP-324. Should be noted that the lengths are still
/// implicitly authenticated by the message packets.
#[derive(Clone)]
pub struct FSChaCha20 {
Expand Down
Loading