Skip to content

signBIP322Simple

Signs a message using the BIP322 simple signing scheme.

Import

ts
import { signBIP322Simple } from "@midl/node";
import { networks } from "bitcoinjs-lib";

Example

ts
const signature = signBIP322Simple(
  "Hello, world!",
  "L2V5...wif",
  "bcrt1q...",
  networks.regtest,
);

Parameters

NameTypeDescription
messagestringMessage to sign.
privateKeystringPrivate key in WIF format.
addressstringAddress that corresponds to the key.
networkNetworkbitcoinjs-lib network instance.

Returns

string — Base64-encoded BIP322 signature.

Released under the MIT License