diff --git a/src/avalanche/proof.h b/src/avalanche/proof.h
--- a/src/avalanche/proof.h
+++ b/src/avalanche/proof.h
@@ -144,6 +144,7 @@
 
     static bool FromHex(Proof &proof, const std::string &hexProof,
                         bilingual_str &errorOut);
+    std::string ToHex() const;
 
     static uint32_t amountToScore(Amount amount);
 
diff --git a/src/avalanche/proof.cpp b/src/avalanche/proof.cpp
--- a/src/avalanche/proof.cpp
+++ b/src/avalanche/proof.cpp
@@ -79,6 +79,12 @@
     return true;
 }
 
+std::string Proof::ToHex() const {
+    CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
+    ss << *this;
+    return HexStr(ss);
+}
+
 void Proof::computeProofId() {
     CHashWriter ss(SER_GETHASH, 0);
     ss << sequence;
diff --git a/src/rpc/avalanche.cpp b/src/rpc/avalanche.cpp
--- a/src/rpc/avalanche.cpp
+++ b/src/rpc/avalanche.cpp
@@ -325,9 +325,7 @@
 
             const avalanche::ProofRef proof = pb.build();
 
-            CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
-            ss << *proof;
-            return HexStr(ss);
+            return proof->ToHex();
         },
     };
 }
@@ -819,11 +817,8 @@
                                  const avalanche::Peer &peer) {
                 UniValue obj(UniValue::VOBJ);
 
-                CDataStream serproof(SER_NETWORK, PROTOCOL_VERSION);
-                serproof << *peer.proof;
-
                 obj.pushKV("peerid", uint64_t(peer.peerid));
-                obj.pushKV("proof", HexStr(serproof));
+                obj.pushKV("proof", peer.proof->ToHex());
 
                 UniValue nodes(UniValue::VARR);
                 pm.forEachNode(peer, [&](const avalanche::Node &n) {