• About
  • FAQ
  • Earn Bitcoin while Surfing the net
  • Buy & Sell Crypto on Paxful
Newsletter
Approx Foundation
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
Approx Foundation
No Result
View All Result
Home Bitcoin

Verifying the address and the message using the public key, address, and signature!

Moussa by Moussa
August 31, 2025
in Bitcoin
0
peer discovery – how to obtain the IP addresses of nodes for mining pools?
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


bitcoinjs-message uses traditional signing process which simply sign message with prefix(if not given) \x18Bitcoin Signed Message:\n. This kind of signing schema has been common but has limitation as it only supports p2pkh. There are implementations which support other type of address with this schema(bitcoinjs-message also supports p2wpkh and p2sh-p2wpkh, but not p2tr), but there’s no strict standard for it.

BIP322 suggests a new way of signing schema, in which virtual transaction is required to sign and verify all types of addresses while p2pkh uses traditional signing process. However, it’s still in development and not yet implemented in bitcoin-core as I know.

I was also looking for bip322 message signing library, and just end up implementing it by myself. If you need you can use it. My open source bitcoin-sdk-js has a feature of bip322 signing and verifying message with javascript, which support p2pkh, p2wpkh and p2tr. It’s verified with bip322 test vector so you can use it. I would try to follow development of bitcoin-core. Be careful as BIP322 itself is in transition.

Below is how to implement.

import * as bitcoin from 'bitcoin-sdk-js'

const keyPair = await bitcoin.wallet.generateKeyPair();
const privkey = keyPair.privateKey;
const pubkey = keyPair.publicKey;
const legacyAddress = await bitcoin.address.generateAddress(
  pubkey,
  'legacy',
);
const segwitAddress = await bitcoin.address.generateAddress(
  pubkey,
  'segwit',
);
const tapAddress = await bitcoin.address.generateAddress(
  (
    await bitcoin.tapscript.getTapTweakedPubkey(
      pubkey.slice(2),
      await bitcoin.tapscript.getTapTweak(pubkey.slice(2)),
    )
  ).tweakedPubKey,
  'taproot',
);
const msg = 'message you want to sign';
// When
const sigLegacy = await bitcoin.crypto.signMessage(
   msg,
   privkey,
   legacyAddress,
);
const sigSegwit = await bitcoin.crypto.signMessage(
  msg,
  privkey,
  segwitAddress,
);
const sigTap = await bitcoin.crypto.signMessage(msg, privkey, tapAddress);
// Then
assert.strictEqual(
  await bitcoin.crypto.verifyMessage(msg, sigLegacy, legacyAddress),
  true,
);
assert.strictEqual(
  await bitcoin.crypto.verifyMessage(msg, sigSegwit, segwitAddress),
  true,
);
assert.strictEqual(
  await bitcoin.crypto.verifyMessage(msg, sigTap, tapAddress),
  true,
);

p.s. I think the website you refer might have an issue with non-ASCII encoding, I recommend this website to test traditional message signing.



Source link

Related articles

How do Bitcoin mining pools typically handle payout frequency versus thresholds?

blockchain – SCAMMED BTC RECOVERY

March 24, 2026
Oil at $100+ and the ‘Digital Gold’ Thesis: Investors Are Flocking to Bitcoin USD

Oil at $100+ and the ‘Digital Gold’ Thesis: Investors Are Flocking to Bitcoin USD

March 24, 2026
Share76Tweet47

Related Posts

How do Bitcoin mining pools typically handle payout frequency versus thresholds?

blockchain – SCAMMED BTC RECOVERY

by Moussa
March 24, 2026
0

need an advice. I am currently processing acrypto recovery,with an agencycalled, recovering@usa .com and we did some transaction validation. Out...

Oil at $100+ and the ‘Digital Gold’ Thesis: Investors Are Flocking to Bitcoin USD

Oil at $100+ and the ‘Digital Gold’ Thesis: Investors Are Flocking to Bitcoin USD

by Moussa
March 24, 2026
0

While global markets panic over rising Oil Prices and geopolitical tension in the Middle East, Bitcoin is doing something unexpected....

Warren Seeks Details Of MrBeast’s Crypto Plans, Orders Response By April 3

Warren Seeks Details Of MrBeast’s Crypto Plans, Orders Response By April 3

by Moussa
March 24, 2026
0

Trusted Editorial content, reviewed by leading industry experts and seasoned editors. Ad Disclosure Senator Elizabeth Warren has formally pressed Beast...

Strategy Discloses $42 Billion Fundraising Plan To Hit 1 Million Bitcoin Target By End Of 2026

Strategy Discloses $42 Billion Fundraising Plan To Hit 1 Million Bitcoin Target By End Of 2026

by Moussa
March 24, 2026
0

Strategy, formerly known as MicroStrategy and led by Michael Saylor, disclosed a new Bitcoin (BTC) acquisition on Monday while simultaneously...

MoonPay Launches Open-Source Wallet Standard For AI Agents

MoonPay Launches Open-Source Wallet Standard For AI Agents

by Moussa
March 24, 2026
0

MoonPay recently launched an open-source wallet standard to equip artificial intelligence (AI) agents with the ability to manage funds and...

Load More

youssufi.com

sephina.com

[vc_row full_width="stretch_row" parallax="content-moving" vc_row_background="" background_repeat="no-repeat" background_position="center center" footer_scheme="dark" css=".vc_custom_1517813231908{padding-top: 60px !important;padding-bottom: 30px !important;background-color: #191818 !important;background-position: center;background-repeat: no-repeat !important;background-size: cover !important;}" footer_widget_title_color="#fcbf46" footer_button_bg="#fcb11e"][vc_column width="1/4"]

We bring you the latest in Crypto News

[/vc_column][vc_column width="1/4"][vc_wp_categories]
[/vc_column][vc_column width="1/4"][vc_wp_tagcloud taxonomy="post_tag"][/vc_column][vc_column width="1/4"]

Newsletter

[vc_raw_html]JTNDcCUzRSUzQ2RpdiUyMGNsYXNzJTNEJTIydG5wJTIwdG5wLXN1YnNjcmlwdGlvbiUyMiUzRSUwQSUzQ2Zvcm0lMjBtZXRob2QlM0QlMjJwb3N0JTIyJTIwYWN0aW9uJTNEJTIyaHR0cHMlM0ElMkYlMkZhcHByb3gub3JnJTJGJTNGbmElM0RzJTIyJTNFJTBBJTBBJTNDaW5wdXQlMjB0eXBlJTNEJTIyaGlkZGVuJTIyJTIwbmFtZSUzRCUyMm5sYW5nJTIyJTIwdmFsdWUlM0QlMjIlMjIlM0UlM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1maXJzdG5hbWUlMjIlM0UlM0NsYWJlbCUyMGZvciUzRCUyMnRucC0xJTIyJTNFRmlyc3QlMjBuYW1lJTIwb3IlMjBmdWxsJTIwbmFtZSUzQyUyRmxhYmVsJTNFJTBBJTNDaW5wdXQlMjBjbGFzcyUzRCUyMnR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RiUzRSUzQyUyRnAlM0U=[/vc_raw_html][/vc_column][/vc_row]
No Result
View All Result
  • Contact Us
  • Homepages
  • Business
  • Guide

© 2024 APPROX FOUNDATION - The Crypto Currency News