Setup 5d15508bba929f1f074c052ac933863eadf6eb8e56984ebd5a1af75e80626643 Portable a5d346b97f5a13d85fa3bd301a72075ddb82fe636d7b1a51840ffd5a16d879f4 Bundled since 0.3.27: 32d4b75 - Aegis (bchwallet) gains its own update card in Settings > General beside Ariadne. Check for updates hits the same signed OTA endpoint the boot timer uses; Restart to apply appears when a signed newer version is staged. Uses the existing addons-check-updates + a new app-restart IPC. New Aegis versions ship without a Theseus release. 32d4b75 (same commit) - DevTools (F12 / Ctrl+Shift+I) opens docked to the right of the tab (mode: 'right') instead of a detached window. Matches stock Chrome. Users who prefer detached can drag out via the DevTools own toolbar. b71c925 - Search-engine favicons in Settings > Search now use Google's /s2/favicons service — DuckDuckGo's ip3 source returned 404 for enough hosts (Brave, Bing, Yandex, etc.) that half the list was falling through to the emoji placeholder. Deployed. Verified LIVE 0.3.28.
53 lines
No EOL
2 KiB
JavaScript
53 lines
No EOL
2 KiB
JavaScript
import { payments, initEccLib } from 'bitcoinjs-lib';
|
|
import * as ecc from '@bitcoinerlab/secp256k1';
|
|
import { digibyte, digibyteLegacyP2SH } from './network.js';
|
|
// Required for Taproot address derivation (P2TR).
|
|
initEccLib(ecc);
|
|
export function p2pkhAddress(node, network = digibyte) {
|
|
const { address } = payments.p2pkh({
|
|
pubkey: Buffer.from(node.publicKey),
|
|
network,
|
|
});
|
|
if (!address)
|
|
throw new Error('p2pkh derivation returned no address');
|
|
return address;
|
|
}
|
|
export function p2shP2wpkhAddress(node, network = digibyte) {
|
|
const redeem = payments.p2wpkh({
|
|
pubkey: Buffer.from(node.publicKey),
|
|
network,
|
|
});
|
|
const { address } = payments.p2sh({ redeem, network });
|
|
if (!address)
|
|
throw new Error('p2sh-p2wpkh derivation returned no address');
|
|
return address;
|
|
}
|
|
// Derive the "S..." (current DGB, scriptHash 0x3f) AND "3..." (legacy
|
|
// Bitcoin-compatible, scriptHash 0x05) BIP49 addresses for the same
|
|
// key. Ian Coleman's BIP39 tool and several older wallets generate the
|
|
// legacy "3..." variant, so any seed-recovery scan must check both.
|
|
export function p2shP2wpkhAddressesBoth(node) {
|
|
return {
|
|
modern: p2shP2wpkhAddress(node, digibyte),
|
|
legacy: p2shP2wpkhAddress(node, digibyteLegacyP2SH),
|
|
};
|
|
}
|
|
export function p2wpkhAddress(node, network = digibyte) {
|
|
const { address } = payments.p2wpkh({
|
|
pubkey: Buffer.from(node.publicKey),
|
|
network,
|
|
});
|
|
if (!address)
|
|
throw new Error('p2wpkh derivation returned no address');
|
|
return address;
|
|
}
|
|
// BIP86 Taproot address using the x-only pubkey with no script tree,
|
|
// which applies the standard BIP86 tweak internally in bitcoinjs-lib.
|
|
export function p2trAddress(node, network = digibyte) {
|
|
const internalPubkey = Buffer.from(node.publicKey.subarray(1, 33));
|
|
const { address } = payments.p2tr({ internalPubkey, network });
|
|
if (!address)
|
|
throw new Error('p2tr derivation returned no address');
|
|
return address;
|
|
}
|
|
//# sourceMappingURL=address.js.map
|