Coder Social home page Coder Social logo

Comments (5)

mccwdev avatar mccwdev commented on July 22, 2024

Please check if the unisat wallet is not using a different key path.

And I think it should be like this:

 addr = Address(hashed_data=key.hash160, script_type='p2tr', encoding='bech32').address

from bitcoinlib.

iteh3712198 avatar iteh3712198 commented on July 22, 2024

Please check if the unisat wallet is not using a different key path.

And I think it should be like this:

 addr = Address(hashed_data=key.hash160, script_type='p2tr', encoding='bech32').address

I used this method, but the address I got was inconsistent with the address shown in my wallet

from bitcoinlib.

mccwdev avatar mccwdev commented on July 22, 2024

Did you check the key paths?

I did some tests, and compared to other wallets, but could not find any problems.

from bitcoinlib.

iteh3712198 avatar iteh3712198 commented on July 22, 2024

Did you check the key paths?

I did some tests, and compared to other wallets, but could not find any problems.

I exported the WIF private key from the unisat wallet and then used the following code to get the taproot address, can you help me see where I might be going wrong?

from bitcoinlib.keys import *
 key = Key(wif_key)
 addr = Address(hashed_data=key.hash160, script_type='p2tr', encoding='bech32').address

from bitcoinlib.

mccwdev avatar mccwdev commented on July 22, 2024

I think taproot uses the public key instead of the hashed public key for the address.

Can you try it like this:

from bitcoinlib.keys import *
key = Key(wif_key)
addr = Address(hashed_data=key.public_hash, script_type='p2tr', encoding='bech32').address

from bitcoinlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.