From 64934689593ce2331a4d3488d5ae95de90e8b70a Mon Sep 17 00:00:00 2001 From: osaka-kun Date: Tue, 12 Sep 2017 20:20:26 +0300 Subject: [PATCH] Checking rangeproof explanatory comment (#120) --- core/src/core/transaction.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/core/transaction.rs b/core/src/core/transaction.rs index f8837cb80..af2cc497c 100644 --- a/core/src/core/transaction.rs +++ b/core/src/core/transaction.rs @@ -333,6 +333,8 @@ impl Output { /// Validates the range proof using the commitment pub fn verify_proof(&self, secp: &Secp256k1) -> Result<(), secp::Error> { + /// secp.verify returns range if and only if both min_value and max_value less than 2^64 + /// since group order is much larger (~2^256) we can be sure overflow is not the case secp.verify_range_proof(self.commit, self.proof).map(|_| ()) } }