From 0f67580e8fc1d98a67298ecc1d70ef926521657a Mon Sep 17 00:00:00 2001 From: reemuru Date: Tue, 18 Jan 2022 16:10:56 -0500 Subject: Advanced: ReserveProof: Add support for reserve proof This change adds the ability to prove and check a reserve proof to this existing "Prove/check" advanced menu. If the amount line has a valid amount less than that of the current account index this input will drive the logic for generating a reserve proof. Checking a reserve proof is accomplished by validating the address and verifying that signature.indexOf("ReserveProofV") === 0. The result displays the total and spent amount of the proof. --- js/TxUtils.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js') diff --git a/js/TxUtils.js b/js/TxUtils.js index 63405338..de79b625 100644 --- a/js/TxUtils.js +++ b/js/TxUtils.js @@ -61,6 +61,10 @@ function checkSignature(signature) { if ((signature.length - 12) % 88 != 0) return false; return check256(signature, signature.length); + } else if (signature.indexOf("ReserveProofV") === 0) { + if ((signature.length - 14) % 447 != 0) + return false; + return check256(signature, signature.length); } return false; } -- cgit v1.2.3