Add npub encoding and PeerIdentity to identity module

- Add bech32 dependency for NIP-19 npub encoding
- Add encode_npub/decode_npub functions
- Add Identity::npub() method
- Add PeerIdentity type for remote peers (public key only)
  - from_npub() constructor
  - verify() for signature verification
- Export new types from lib.rs
- Update main.rs with verbose authentication demo
- 20 tests passing
This commit is contained in:
Johnathan Corgan
2026-01-25 00:40:59 +00:00
parent db4989a790
commit ac2f6a75c8
5 changed files with 329 additions and 3 deletions
Generated
+7
View File
@@ -8,6 +8,12 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
name = "bech32"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32637268377fc7b10a8c6d51de3e7fba1ce5dd371a96e342b34e6078db558e7f"
[[package]]
name = "bitcoin-io"
version = "0.1.4"
@@ -88,6 +94,7 @@ checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
name = "fips"
version = "0.1.0"
dependencies = [
"bech32",
"hex",
"rand",
"secp256k1",