MCPcopy Create free account
hub / github.com/CashScript/cashscript / publicKeyToP2PKHLockingBytecode

Function publicKeyToP2PKHLockingBytecode

packages/cashscript/src/utils.ts:307–312  ·  view source on GitHub ↗
(publicKey: Uint8Array)

Source from the content-addressed store, hash-verified

305}
306
307export function publicKeyToP2PKHLockingBytecode(publicKey: Uint8Array): Uint8Array {
308 const pubkeyHash = hash160(publicKey);
309 const addressContents = { payload: pubkeyHash, type: LockingBytecodeType.p2pkh };
310 const lockingBytecode = addressContentsToLockingBytecode(addressContents);
311 return lockingBytecode;
312}
313
314export function utxoComparator(a: Utxo, b: Utxo): number {
315 if (a.satoshis > b.satoshis) return 1;

Callers 1

unlockP2PKHMethod · 0.85

Calls 1

hash160Function · 0.90

Tested by

no test coverage detected