You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very basic initial implementation of BIP-352 Silent Payments.
This small start only generates the shareable, reusable Silent Payment address.
Rough TODO list for full SP support is included in the python comments, some of which are dependant on not-yet-settled discussions. Other parts that could be implemented now are, to be honest, beyond my abilities. Hopefully this starting point will encourage others to start filling in those holes.
AI review of BIP-352 implementation against the spec
(Take it with a grain of salt.)
Non-spec labels accepted (high): Code and tests allow str/bytes labels, but BIP-352 labels are ser_32(m) integers. This can break interoperability/recovery across compliant wallets. src/embit/bip352.py:26src/embit/bip352.py:35tests/tests/test_bip352.py:74bips/bip-0352.mediawiki:201bips/bip-0352.mediawiki:139
No compressed-key / 66-byte enforcement for v0 address payload (high): Address generation uses raw sec() concatenation without checking compressed keys, so uncompressed pubkeys can produce non-compliant v0 addresses. src/embit/bip352.py:20bips/bip-0352.mediawiki:141bips/bip-0352.mediawiki:180
BIP352 tests not in default suite (high):test_bip352.py is not imported by tests/tests/__init__.py; it also depends on pytest, so it can be skipped in normal unittest runs. tests/tests/__init__.py:1tests/tests/test_bip352.py:9
Network argument handling can produce wrong HRP (medium): Logic treats only literal "main" as mainnet; passing network dicts (common elsewhere in repo) yields testnet HRP (tsp) even for mainnet. src/embit/bip352.py:21src/embit/script.py:15bips/bip-0352.mediawiki:204
Missing explicit scalar-validity checks for label tweak (medium): Spec requires failure on invalid scalars (0 or >=n). Current label tweak path relies on backend behavior; consistency risk across ctypes vs pure-python secp backends. src/embit/bip352.py:42src/embit/util/ctypes_secp256k1.py:677src/embit/util/py_secp256k1.py:229bips/bip-0352.mediawiki:302
Version semantics under-specified (medium): Function accepts arbitrary version but does not enforce/reject according to BIP-352 v0 rules (including v31 fail behavior). src/embit/bip352.py:16bips/bip-0352.mediawiki:179bips/bip-0352.mediawiki:182
Test coverage is much narrower than spec vectors/functional requirements (medium): Current tests only cover address construction basics and label samples, missing sender/receiver protocol behaviors and edge cases from official vectors. tests/tests/test_bip352.py:15bips/bip-0352.mediawiki:379bips/bip-0352.mediawiki:444
Architectural incompleteness vs full BIP scope (medium): Module currently implements only address construction; sender output derivation, receiver scanning, and spending flows are not implemented. src/embit/bip352.py:5bips/bip-0352.mediawiki:283bips/bip-0352.mediawiki:333bips/bip-0352.mediawiki:362
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Very basic initial implementation of BIP-352 Silent Payments.
This small start only generates the shareable, reusable Silent Payment address.
Rough TODO list for full SP support is included in the python comments, some of which are dependant on not-yet-settled discussions. Other parts that could be implemented now are, to be honest, beyond my abilities. Hopefully this starting point will encourage others to start filling in those holes.