diff --git a/bip-0374.mediawiki b/bip-0374.mediawiki
index ff5686c5..7e3bdffb 100644
--- a/bip-0374.mediawiki
+++ b/bip-0374.mediawiki
@@ -11,7 +11,7 @@
License: BSD-2-Clause
Discussion: https://gist.github.com/andrewtoth/df97c3260cc8d12f09d3855ee61322ea
https://groups.google.com/g/bitcoindev/c/MezoKV5md7s
- Version: 0.2.0
+ Version: 0.3.0
== Introduction ==
@@ -79,7 +79,7 @@ The algorithm ''GenerateProof(a, B, r, G, m)'' is defined as:
* Fail if ''k = 0''.
* Let ''R1 = k⋅G''.
* Let ''R2 = k⋅B''.
-* Let ''e = int(hashBIP0374/challenge(cbytes(A) || cbytes(B) || cbytes(C) || cbytes(G) || cbytes(R1) || cbytes(R2) || m'))''.
+* Let ''e = int(hashBIP0374/challenge(cbytes(A) || cbytes(B) || cbytes(C) || cbytes(G) || cbytes(R1) || cbytes(R2) || m')) mod n''.
* Let ''s = (k + e⋅a) mod n''.
* Let ''proof = bytes(32, e) || bytes(32, s)''.
* If ''VerifyProof(A, B, C, proof, G, m)'' (see below) returns failure, abort.
@@ -99,14 +99,14 @@ Input:
The algorithm ''VerifyProof(A, B, C, proof, G, m)'' is defined as:
* Fail if any of ''is_infinite(A)'', ''is_infinite(B)'', ''is_infinite(C)'', ''is_infinite(G)''
-* Let ''e = int(proof[0:32])''.
+* Let ''e = int(proof[0:32])''; fail if ''e ≥ n''.
* Let ''s = int(proof[32:64])''; fail if ''s ≥ n''.
* Let ''R1 = s⋅G - e⋅A''.
* Fail if ''is_infinite(R1)''.
* Let ''R2 = s⋅B - e⋅C''.
* Fail if ''is_infinite(R2)''.
* Let ''m' = m if m is provided, otherwise an empty byte array''.
-* Fail if ''e ≠ int(hashBIP0374/challenge(cbytes(A) || cbytes(B) || cbytes(C) || cbytes(G) || cbytes(R1) || cbytes(R2) || m'))''.
+* Fail if ''e ≠ int(hashBIP0374/challenge(cbytes(A) || cbytes(B) || cbytes(C) || cbytes(G) || cbytes(R1) || cbytes(R2) || m')) mod n''.
* Return success iff no failure occurred before reaching this point.
==Backwards Compatibility==
@@ -124,6 +124,8 @@ Test vectors can be generated by running ./bip-0374/gen_test_vectors.py= GE.ORDER:
+ return False
s = int.from_bytes(proof[32:], "big")
if s >= GE.ORDER:
return False