Bitcoin Node
Command Line
bitcoin-cli verifymessage <address> <signature> <message>
RPC
curl
--user <rpcuser>:<rpcpassword> \
--data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifymessage", "params": [<address>, <signature>, <message>] }' \
-H 'content-type: text/plain;' \
http://127.0.0.1:8332/
JavaScript
Command Line
npx verify-bitcoin-message --json \
--address 1F3sAm6ZtwLAUnj7d38pGFxtP3RVEvtsbV \
--message "This is an example of a signed message." \
--signature "H9L5yLFjti0QTHhPyFrZCT1V/MMnBtXKmoiKDZ78NDBjERki6ZTQZdSMCtkgoNmp17By9ItJr8o7ChX0XxY91nk="
Browser
<script type="module">
import verify, { verifySafe } from 'https://unpkg.com/verify-bitcoin-message';
</script>
<!-- Legacy Script Tag -->
<script type="text/javascript" src="https://unpkg.com/verify-bitcoin-message">
</script>
Node
npm install verify-bitcoin-message
Bun
bun add verify-bitcoin-message
Usage
import verify, { verifySafe } from 'verify-bitcoin-message';
await verify({
address: '1F3sAm6ZtwLAUnj7d38pGFxtP3RVEvtsbV',
message: 'This is an example of a signed message.',
signature: 'H9L5yLFjti0QTHhPyFrZCT1V/MMnBtXKmoiKDZ78NDBjERki6ZTQZdSMCtkgoNmp17By9ItJr8o7ChX0XxY91nk='
})
// If you're not a fan of throwing errors:
const isValid = await verifySafe({
address: '1F3sAm6ZtwLAUnj7d38pGFxtP3RVEvtsbV',
message: 'This is an example of a signed message.',
signature: 'H9L5yLFjti0QTHhPyFrZCT1V/MMnBtXKmoiKDZ78NDBjERki6ZTQZdSMCtkgoNmp17By9ItJr8o7ChX0XxY91nk='
})