• Home
  • About Us
  • disclaimer
  • Privacy Policy
  • Terms and Conditions
  • Contact Us
Crypto News
  • Home
  • Crypto News
  • Team Portofolio (Premium)
  • Member Login
No Result
View All Result
  • Home
  • Crypto News
  • Team Portofolio (Premium)
  • Member Login
No Result
View All Result
Crypto News
No Result
View All Result
Home Crypto News

javascript – signal a message with privateKey on Bitcoin utilizing TS/JS?

Cryptoadmin by Cryptoadmin
September 18, 2024
in Crypto News
0
BEST CRYPTO RECOVERY FIRM 2024
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


I am attempting to signal the message to UniSat to this endpoint
Bind btcAddress and nftAddress.

Utilizing code like:

import * as bitcoin from 'bitcoinjs-lib';
import * as ecc from 'tiny-secp256k1';
import * as bitcoinMessage from 'bitcoinjs-message';
import { ECPairFactory } from 'ecpair';
import * as crypto from 'crypto';
import * as secp256k1 from 'tiny-secp256k1';

const ECPair = ECPairFactory(ecc);


perform signMessage(privateKeyWIF: string, message: string): string {
    const ecPair = ECPair.fromWIF(privateKeyWIF, bitcoin.networks.bitcoin);
    const privateKey = ecPair.privateKey;
    const compressed = ecPair.compressed;

    if (!privateKey) {
        throw new Error('Personal secret's lacking');
    }

    // Signal the message
    const signature = bitcoinMessage.signal(message, privateKey, compressed);

    // Encode the signature in base64
    const signatureCompact = signature.slice(1, 65).toString('hex');

    return signatureCompact;
}

const message: string = `Please affirm thatnPayment Deal with: ${paymentAddress}nOrdinals Deal with: ${ordinalsAddress}`;

const signature: string = signMessage(privateKey, message);

However on the response receiving:

{
  btcAddress: 'bc1q5fqwlf88dtu9qa2jkvwhjr94k07cerfau3mh9s',
  nftAddress: 'bc1p7n462ru9wtfgclwedfgp0eqe6w40pjwt7wvkxgdmzue2y6ptdkvsuzzmu2',
  signal: '732505d8a18002ec9b16600558457a1695c7b5b7b93b0001f566953fe8052c8b1d82d25d8233d675a8c22bacaa5858dab37b623d7fcccf5d58d8a80580d704af'
}
{
  code: -1,
  msg: 'Signature.fromCompact: Anticipated 64-byte hex',
  knowledge: null
}

What am I doing flawed?

Thanks to your assist.

Tags: BitcoinjavascriptmessageprivateKeysignTSJS
Share76Tweet47
  • Trending
  • Comments
  • Latest
USDG Rewards: Earn as much as 4%+ APR in USDG on Kraken

USDG Rewards: Earn as much as 4%+ APR in USDG on Kraken

April 10, 2025
How Essential is Jito Solana MEV Bot Growth for the Cryptocurrency Ecosystem?

How Essential is Jito Solana MEV Bot Growth for the Cryptocurrency Ecosystem?

July 31, 2024
PURA Cost Processing | CoinPayments

PURA Cost Processing | CoinPayments

May 13, 2024
SUI staking is now dwell on Kraken – earn as much as 3%

SUI staking is now dwell on Kraken – earn as much as 3%

July 7, 2025
Ethiopia to begin mining Bitcoin by means of new information mining partnership

Ethiopia to begin mining Bitcoin by means of new information mining partnership

0
Be part of HitBTC official social media channels !

Be part of HitBTC official social media channels !

0
Bitwise launching spot bitcoin ETF (BITB) – CryptoNinjas

Bitwise launching spot bitcoin ETF (BITB) – CryptoNinjas

0
DeFi Masterclass. Decentralized Finance (DeFi) is an… | by Rohas Nagpal | Blockchain Weblog

DeFi Masterclass. Decentralized Finance (DeFi) is an… | by Rohas Nagpal | Blockchain Weblog

0
BAYC NFT Creator Set To Host Its ApeFest NFT Occasion Subsequent Week

BAYC NFT Creator Set To Host Its ApeFest NFT Occasion Subsequent Week

October 19, 2025
Financial institution of England to Introduce Stablecoin Regulation by 2026

Financial institution of England to Introduce Stablecoin Regulation by 2026

October 18, 2025
New debt-fueled period for Bitcoin miners marked by 1 zetahash milestone

New debt-fueled period for Bitcoin miners marked by 1 zetahash milestone

October 18, 2025
DOGE Worth Breaks Key Assist: Is Alt Run No Extra?

DOGE Worth Breaks Key Assist: Is Alt Run No Extra?

October 18, 2025

About Us

Welcome to Blog.cryptostudy.net The goal of Blog.cryptostudy.net is to give you the absolute best news sources for any topic! Our topics are carefully curated and constantly updated as we know the web moves fast so we try to as well.

Recent Posts

  • BAYC NFT Creator Set To Host Its ApeFest NFT Occasion Subsequent Week
  • Financial institution of England to Introduce Stablecoin Regulation by 2026
  • New debt-fueled period for Bitcoin miners marked by 1 zetahash milestone
  • Home
  • About Us
  • disclaimer
  • Privacy Policy
  • Terms and Conditions
  • Contact Us

Copyright © 2024 Blog.cryptostudy.net | All Rights Reserved.

No Result
View All Result
  • Home
  • Crypto News
  • Team Portofolio (Premium)
  • Member Login

Copyright © 2024 Blog.cryptostudy.net | All Rights Reserved.