Comments (5)
update:
keyx1 = Key(bytes_to_wif(bytes.fromhex('hexdata'),compressed=False)) seems fastest way currently. still 8% to 10% down from compressed address.
from bit.
so you know , how to get native segwit address,
key.segwit_address returns only nested p2sh segwit address, not native one that starts from bc1
from bit.
@rockygsm
Is there any way to generate the Native segwit address, and tabroot address.
I hope if not, it will be supported soon.
from bit.
public_key_to_address
can display the uncompressed address without creating a new Key
instance.
>>> from bit import Key
>>> from bit.format import public_key_to_address
>>> k = Key.from_hex('0000000000000000000000000000000000000000000000000000000000000001')
>>> k.address
'1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH'
# compressed P2PKH
>>> public_key_to_address(k._pk.public_key.format(compressed=True),'main')
'1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH'
# compressed P2PKH
>>> public_key_to_address(k._pk.public_key.format(compressed=False),'main')
'1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm'
# uncompressed P2PKH
from bit.
Is there any way to generate the Native segwit address
from bit import PrivateKey
def get_bech32_address():
byte_public_key_comp = PrivateKey("your_private_key")._pk.public_key.format()
witprog = ripemd160_sha256(byte_public_key_comp)
bech32_address = encode('bc', 0, witprog)
return bech32_address
print("SegWit Native:", get_bech32_address())
from bit.
Related Issues (20)
- Can't get balance and public key calculated wrong? HOT 1
- How to instantiate MultiSigTestnet to create a MultiSig 2 of 3?
- logging in your project will damage other logging's output format HOT 2
- Transaction broadcast failed HOT 2
- Ubuntu 22.04 - ValueError: unsupported hash type ripemd160 HOT 4
- TypeError: AlertMixin.success() takes 2 positional arguments but 3 were given HOT 1
- ConnectionError: Transaction broadcast failed, or Unspents were already used. HOT 1
- Sending Bitcoin Dust HOT 1
- Pay fee from transaction HOT 1
- Question on compressed and uncompressed addresses
- maximum from_int value
- Cannot set op_return as first output
- How to check if a P2SH address is a multisig address or not?
- Looking to generate a bech32 address HOT 1
- Manage UTXOs
- Generate new address on Bitcoin using same key HOT 2
- Create and manage OP CODES
- Required signatures cannot be more than the total number of public keys.
- Why are the results of BTC message signature implemented in Python different from those on electrum?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bit.