Skip to content
Draft
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
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