Skip to content

Commit 39f578d

Browse files
author
EchoBT
committed
fix: Derive peer ID from hotkey (public key) not seed
The peer ID is now derived from the SR25519 public key (hotkey), ensuring a 1:1 correspondence between SS58 address and peer ID. SS58: 5GziQCcRpN8NCJktX343brnfuVe3w6gUYieeStXPD1Dag2At Peer ID: 12D3KooWEpZoR9A1fpMN4QGspuRSa9UYHYvnFda2GWkXXZyYgAkN
1 parent 9f270af commit 39f578d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

bins/validator-node/src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ async fn main() -> Result<()> {
177177
info!("Validator hotkey (hex): {}", keypair.hotkey().to_hex());
178178
info!("Validator SS58 address: {}", keypair.ss58_address());
179179

180-
// The identity seed for P2P is derived from the keypair seed
181-
let identity_seed = keypair.seed();
180+
// The identity seed for P2P is derived from the hotkey (public key)
181+
// This ensures the peer ID corresponds to the SS58 address
182+
let identity_seed = keypair.hotkey().0;
182183

183184
// Canonicalize data directory to ensure absolute paths for Docker
184185
let data_dir = if args.data_dir.exists() {

0 commit comments

Comments
 (0)