diff --git a/Cargo.lock b/Cargo.lock index f70dc814233..6e67ab43089 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6867,6 +6867,7 @@ dependencies = [ "nym-crypto", "nym-ip-packet-requests", "nym-sphinx", + "serde", "tokio-util", ] diff --git a/common/registration/Cargo.toml b/common/registration/Cargo.toml index 22749ccdc9b..9133bad4de1 100644 --- a/common/registration/Cargo.toml +++ b/common/registration/Cargo.toml @@ -13,6 +13,7 @@ workspace = true [dependencies] tokio-util.workspace = true +serde.workspace = true nym-authenticator-requests = { path = "../authenticator-requests" } nym-crypto = { path = "../crypto" } diff --git a/common/registration/src/lib.rs b/common/registration/src/lib.rs index f07ea673ebb..e0812ca2c6a 100644 --- a/common/registration/src/lib.rs +++ b/common/registration/src/lib.rs @@ -1,10 +1,11 @@ // Copyright 2025 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 +use serde::{Deserialize, Serialize}; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}; use nym_authenticator_requests::AuthenticatorVersion; -use nym_crypto::asymmetric::x25519::PublicKey; +use nym_crypto::asymmetric::x25519::{PublicKey, serde_helpers::bs58_x25519_pubkey}; use nym_ip_packet_requests::IpPair; use nym_sphinx::addressing::{NodeIdentity, Recipient}; @@ -16,9 +17,9 @@ pub struct NymNode { pub authenticator_address: Option, pub version: AuthenticatorVersion, } - -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct GatewayData { + #[serde(with = "bs58_x25519_pubkey")] pub public_key: PublicKey, pub endpoint: SocketAddr, pub private_ipv4: Ipv4Addr,