Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2af8978
chore(payment): Implement silent payments
jvgelder Oct 8, 2025
d6f3297
fix(crypto): Added missing tags
jvgelder Oct 8, 2025
52148d8
fix(p2sp): Function signature and output fixes
jvgelder Oct 8, 2025
77c07f7
fix(tests): Properly load fixtures
jvgelder Oct 8, 2025
bd2f200
chore(tests): Cleanup unused or redundant functions
jvgelder Oct 8, 2025
4042a59
chore(test): Clean up unused variables
jvgelder Oct 10, 2025
c8518f3
fix(test): Set k on deriveOutput
jvgelder Oct 10, 2025
4f52dde
chore(p2sp): Move main function to top and add lazy prop
jvgelder Oct 10, 2025
5596888
fix(p2sp): Remove reduce mod add checks
jvgelder Oct 10, 2025
d0af90d
chore(p2sp): Remove dependency on inputs
jvgelder Oct 16, 2025
ef20410
chore(p2sp): Type Uint8Array remove ArrayBufferLike
jvgelder Oct 16, 2025
0c9b7d8
chore(p2sp): Renames
jvgelder Oct 16, 2025
e6d0823
chore(p2sp): Properly type silent payment outputs
jvgelder Oct 16, 2025
0ace2d7
chore(p2sp): Doc improvements
jvgelder Oct 16, 2025
6b8032c
chore(p2sp): Add type for decoded Silent Payment address
jvgelder Oct 16, 2025
7e3c0ee
chore(p2sp): Formatting
jvgelder Oct 16, 2025
87b8d5b
chore(p2sp): Add types
jvgelder Oct 16, 2025
58e9630
chore(p2sp): Make recipients optional
jvgelder Oct 16, 2025
2c4e8e1
chore(p2sp): Remove Output import
jvgelder Oct 16, 2025
797c16d
chore(p2sp): Clarify the output type and distinquish from regular out…
jvgelder Oct 16, 2025
dadd54b
chore(p2sp): Moved functionality to SilentPaymentTransaction
jvgelder Oct 21, 2025
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
21 changes: 21 additions & 0 deletions src/esm/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export const TAGS = [
'TapTweak',
'KeyAgg list',
'KeyAgg coefficient',
'BIP0352/Inputs',
'BIP0352/SharedSecret',
'BIP0352/Label',
];
/**
* A collection of tagged hash prefixes used in various BIP (Bitcoin Improvement Proposals)
Expand Down Expand Up @@ -108,6 +111,24 @@ export const TAGGED_HASH_PREFIXES = {
201, 4, 3, 77, 28, 136, 232, 200, 14, 34, 229, 61, 36, 86, 109, 100, 130,
78, 214, 66, 114, 129, 192, 145, 0, 249, 77, 205, 82, 201, 129,
]),
'BIP0352/Inputs': Uint8Array.from([
30, 123, 150, 235, 22, 10, 104, 129, 159, 151, 118, 75, 67, 213, 215, 126,
102, 89, 215, 88, 119, 157, 67, 168, 167, 117, 95, 91, 228, 90, 126, 51, 30,
123, 150, 235, 22, 10, 104, 129, 159, 151, 118, 75, 67, 213, 215, 126, 102,
89, 215, 88, 119, 157, 67, 168, 167, 117, 95, 91, 228, 90, 126, 51,
]),
'BIP0352/SharedSecret': Uint8Array.from([
159, 109, 128, 17, 88, 30, 182, 45, 114, 230, 19, 96, 76, 51, 13, 202, 42,
11, 211, 73, 226, 74, 70, 217, 162, 239, 36, 185, 169, 143, 65, 189, 159,
109, 128, 17, 88, 30, 182, 45, 114, 230, 19, 96, 76, 51, 13, 202, 42, 11,
211, 73, 226, 74, 70, 217, 162, 239, 36, 185, 169, 143, 65, 189,
]),
'BIP0352/Label': Uint8Array.from([
3, 73, 25, 70, 53, 194, 208, 62, 98, 212, 19, 186, 140, 205, 81, 152, 145,
144, 23, 161, 233, 156, 190, 105, 31, 90, 52, 169, 147, 119, 224, 149, 3,
73, 25, 70, 53, 194, 208, 62, 98, 212, 19, 186, 140, 205, 81, 152, 145, 144,
23, 161, 233, 156, 190, 105, 31, 90, 52, 169, 147, 119, 224, 149,
]),
};
/**
* Computes a tagged hash using the specified prefix and data.
Expand Down
16 changes: 15 additions & 1 deletion src/esm/payments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ import { p2sh } from './p2sh.js';
import { p2wpkh } from './p2wpkh.js';
import { p2wsh } from './p2wsh.js';
import { p2tr } from './p2tr.js';
export { embed, p2ms, p2pk, p2pkh, p2sh, p2wpkh, p2wsh, p2tr };
import { p2sp, scanForSilentPayments, deriveOutput } from './p2sp.js';
export {
embed,
p2ms,
p2pk,
p2pkh,
p2sh,
p2wpkh,
p2wsh,
p2tr,
p2sp,
// TODO how should we expose the two functions below?
scanForSilentPayments,
deriveOutput,
};
// TODO
// witness commitment
Loading