talonlab / python-hdwallet

Python-based library for the implementation of a Hierarchical Deterministic (HD) Wallet generator supporting more than 200 cryptocurrencies.
https://hdwallet.readthedocs.io
MIT License
461 stars 151 forks source link

need feature P2TR standard address #95

Open jjhesk opened 10 months ago

jjhesk commented 10 months ago

As for the title from this package, are there anyways to calculate the base58 secret key and the P2TR standard from the given mnemonic or path of the private key?

A pay-to-taproot (P2TR), also known as a Taproot or Bech32m address, is the most recent and advanced bitcoin address format. Taproot introduces more advanced security, privacy, flexibility and scaling to bitcoin. Like SegWit, Taproot addresses are opt-in and not currently widely supported. Taproot adoption can be tracked here.

Benefits of Taproot include the ability to use Schnorr Signatures, offering better security, lower fees, and more flexible multi-key transactions. Multi-key addresses using P2TR look the same as single-key addresses giving users of multi-key increased privacy. Taproot also enables more advanced scripting, enabling more complex smart contracts to be built on bitcoin.

Taproot addresses start with bc1p with total length of 62 and are case insensitive. specification

Example: bc1p5d7rjq7g6rdk2yhzks9smlaqtedr4dekq08ge8ztwac72sfr9rusxg3297

{
  value: AddressType.P2PKH,
  label: 'P2PKH',
  name: 'Legacy (P2PKH)',
  hdPath: "m/44'/0'/0'/0",
  displayIndex: 3,
  isUnisatLegacy: false
},
{
  value: AddressType.P2WPKH,
  label: 'P2WPKH',
  name: 'Native Segwit (P2WPKH)',
  hdPath: "m/84'/0'/0'/0",
  displayIndex: 0,
  isUnisatLegacy: false
},
{
  value: AddressType.P2TR,
  label: 'P2TR',
  name: 'Taproot (P2TR)',
  hdPath: "m/86'/0'/0'/0",
  displayIndex: 2,
  isUnisatLegacy: false
},
{
  value: AddressType.P2SH_P2WPKH,
  label: 'P2SH-P2WPKH',
  name: 'Nested Segwit (P2SH-P2WPKH)',
  hdPath: "m/49'/0'/0'/0",
  displayIndex: 1,
  isUnisatLegacy: false
},
{
  value: AddressType.M44_P2WPKH,
  label: 'P2WPKH',
  name: 'Native SegWit (P2WPKH)',
  hdPath: "m/44'/0'/0'/0",
  displayIndex: 4,
  isUnisatLegacy: true
},
{
  value: AddressType.M44_P2TR,
  label: 'P2TR',
  name: 'Taproot (P2TR)',
  hdPath: "m/44'/0'/0'/0",
  displayIndex: 5,
  isUnisatLegacy: true
}
meherett commented 9 months ago

@jjhesk Taproot (P2TR) is already implemented on v3 package. Python-HDWallet v3.0.0 will be released to be available soon. Thanks.

openseauser commented 3 months ago

@jjhesk Taproot (P2TR) is already implemented on v3 package. Python-HDWallet v3.0.0 will be released to be available soon. Thanks.

what's soon mean?