Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bip-0352.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,10 @@ Silent payments introduces a new address format and protocol for sending and as

== Test Vectors ==

A [[bip-0352/send_and_receive_test_vectors.json|collection of test vectors in JSON format]] are provided, along with a [[bip-0352/reference.py|python reference implementation]]. Each test vector consists of a sending test case and corresponding receiving test case. This is to allow sending and receiving to be implemented separately. To ensure determinism while testing, sort the array of ''B<sub>m</sub>'' by amount (see the [[bip-0352/reference.py|reference implementation]]). Test cases use the following schema:
A [[bip-0352/send_and_receive_test_vectors.json|collection of test vectors in JSON format]] are provided, along with a [[bip-0352/reference.py|python reference implementation]]. It uses a vendored copy of the [https://github.com/secp256k1lab/secp256k1lab/ secp256k1lab] library at version 1.0.0
(commit [https://github.com/secp256k1lab/secp256k1lab/commit/44dc4bd893b8f03e621585e3bf255253e0e0fbfb 44dc4bd893b8f03e621585e3bf255253e0e0fbfb]).

Each test vector consists of a sending test case and corresponding receiving test case. This is to allow sending and receiving to be implemented separately. To ensure determinism while testing, sort the array of ''B<sub>m</sub>'' by amount (see the [[bip-0352/reference.py|reference implementation]]). Test cases use the following schema:

''' test_case '''

Expand Down
4 changes: 2 additions & 2 deletions bip-0352/bitcoin_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import struct
from io import BytesIO
from ripemd160 import ripemd160
from secp256k1 import ECKey
from secp256k1lab.secp256k1 import Scalar
from typing import Union


Expand Down Expand Up @@ -93,7 +93,7 @@ def __init__(self, outpoint=None, scriptSig=b"", txinwitness=None, prevout=b"",
else:
self.txinwitness = txinwitness
if private_key is None:
self.private_key = ECKey()
self.private_key = Scalar()
else:
self.private_key = private_key
self.scriptSig = scriptSig
Expand Down
208 changes: 105 additions & 103 deletions bip-0352/reference.py

Large diffs are not rendered by default.

Loading