Tangem Wallet Pack of 2 - Secure Crypto Wallet - Trusted Cold Storage for Bitcoin, Ethereum, NFT's &

Tangem Wallet Pack of 2 - Secure Crypto Wallet - Trusted Cold Storage for Bitcoin, Ethereum, NFT's &
Key item features Ultimate Security: Generates a private key that remains on the card, safeguarding crypto and NFTs from hackers with EAL6+ certification and audited firmware. Versatile Compatibility: Manages over 13,000 tokens across 70+ blockchains, supporting DeFi, NFTs, and DeEx without wires, Bluetooth, or USB. Effortless Operation: Utilizes NFC for secure transactions via a mobile device and the Tangem app, enabling buying and selling crypto with various payment methods. Smart Backup: Features a second Tangem Wallet as a backup, eliminating the need for paper, pictures, or seed phrases for recovery. Durable Design: Boasts IP68 protection against environmental conditions, ensuring longevity and robust physical security. Comprehensive Support: Compatible with Bitcoin, Ethereum, Solana, XRP, USDT, and over 6,000 cryptocurrencies, integrating with dApps and WalletConnect.

LBANK

Correct Configuration for Generating Bitcoin SegWit (BIP84) Addresses

I'm generating SegWit keys and addresses using bitcoinjs-lib. I'm new to Blockchain so I'm using Ian Coleman's bip39 repo for guidance. However, I encountered different key and address outputs when generating them with bitcoinjs-lib compared to the results from Ian Coleman’s tool.

I found out that the reason is in the network config, I'm using the bitcoin network config directly from bitcoinjs-lib, while in that repo there's a custom config.

Here's the config I used:

{
  messagePrefix: '\x18Bitcoin Signed Message:\n',
  bech32: 'bc',
  bip32: {
    public: 0x0488b21e,
    private: 0x0488ade4,
  },
  pubKeyHash: 0x00,
  scriptHash: 0x05
  wif: 0x80,
}

And here’s the config from Ian Coleman's tool:

{
  messagePrefix:"\u0018Bitcoin Signed Message:\n",
  bech32:"bc",
  bip32:
    { 
      public: 78792518, // 0x4B24746
      private: 78791436 // 0x4B2430C
    },
  pubKeyHash: 0, // 0x00
  scriptHash: 5, // 0x05
  wif: 128 // 0x80
}

My result outputs keys that start from xprv and xpub while Ian Coleman's resulted in zprv and zpub.

Given that BIP84 mandates zprv and zpub prefixes for native SegWit keys, Ian Coleman’s config seems more appropriate. However, both configurations generate seemingly correct addresses.

So, my questions are:

  1. Which configuration is correct for generating native SegWit (BIP84) addresses?
  2. Are there any risks or drawbacks in using the xpub/xprv prefixes for SegWit addresses, or will it just affect compatibility with certain wallets?"


from Recent Questions - Bitcoin Stack Exchange https://ift.tt/rJSikyY
via IFTTT

Popular posts from this blog

Crypto Exec Warns Tokenization Is Moving Faster Than Expected

Bitcoin Mining Could Be Strengthening The Ruble, Russian Central Bank Says

Nigerian SEC Partners With Police To Tackle Crypto Ponzi Schemes – Details