Comments (7)
Also tried with BIP49:
print("P2WSH: m/49'/0'/0'/0/"+str(x)+": " + (key/49./0./0./0/x).address('P2WSH'))
but same error
from cryptotools.
For BIP49 you want to use P2WPKH-P2SH
as an address type
You can’t generate P2WSH
, P2SH
or P2WSH-P2SH
addresses from a public key, those require a script as the name suggests
from cryptotools.
Is it possible to generate them from an Xprv or xpub?
xprv = Xprv.from_mnemonic(seed)
xpub = xprv.to_xpub()
print(xprv.to_xpub.to_address('P2WPKH'))
print(xpub.to_address('P2WPKH'))
dit not work
from cryptotools.
I'm trying to generate all possible addresses that the coldcard generates. I used:
def print_addresses(key, max_count):
for x in range(max_count):
print("P2PKH: m/44./0./0./0/"+str(x)+": " + (key/44./0./0./0/x).address('P2PKH')) #appears on coldcard
print("P2WPKH: m/44./0./0./0/"+str(x)+": " + (key/44./0./0./0/x).address('P2WPKH'))
print("P2PKH: m/49'/0'/0'/0/"+str(x)+": " + (key/49./0./0./0/x).address('P2PKH'))
print("P2WPKH: m/49'/0'/0'/0/"+str(x)+": " + (key/49./0./0./0/x).address('P2WPKH'))
print("P2WPKH-P2SH: m/49'/0'/0'/0/"+str(x)+": " + (key/49./0./0./0/x).address('P2WPKH-P2SH')) #appears
on coldcard
but only
P2PKH: m/44./0./0./0/0
P2WPKH-P2SH: m/49'/0'/0'/0/0
matched, there are still 2 sets of addresses that are not covered in this and I don't know. one set starts with bc... and the other 1. Do you know which type are they and how to generate from the seed + passphrase?
from cryptotools.
Ok, turns out this:
def print_addresses(key, max_count):
for x in range(max_count):
print("P2PKH: m/44./0./0./0/"+str(x)+": " + (key/44./0./0./0/x).address('P2PKH'))
print("P2WPKH: m/44./0./0./0/"+str(x)+": " + (key/44./0./0./0/x).address('P2WPKH'))
print("P2WPKH-P2SH: m/49./0./0./0/"+str(x)+": " + (key/49./0./0./0/x).address('P2WPKH-P2SH'))
print("P2PKH: m/49'/0'/0'/0/"+str(x)+": " + (key/49./0./0./0/x).address('P2PKH'))
print("P2WPKH: m/49'/0'/0'/0/"+str(x)+": " + (key/49./0./0./0/x).address('P2WPKH'))
print("P2WPKH-P2SH: m/49'/0'/0'/0/"+str(x)+": " + (key/49./0./0./0/x).address('P2WPKH-P2SH'))
print("P2PKH: m/84'/0'/0'/0/"+str(x)+": " + (key/84./0./0./0/x).address('P2PKH'))
print("P2WPKH: m/84'/0'/0'/0/"+str(x)+": " + (key/84./0./0./0/x).address('P2WPKH'))
print("P2WPKH-P2SH: m/84'/0'/0'/0/"+str(x)+": " + (key/84./0./0./0/x).address('P2WPKH-P2SH'))
generates the 3 sets, except the first set of addresses, for which I don't know how to generate. Do you have an idea? Also feel free to put these in the readme if you want to.
from cryptotools.
BIP44 —> P2PKH
BIP49 —> P2WPKH-P2SH
BIP84 —> P2WPKH
from cryptotools.
def print_addresses(key, max_count):
for x in range(max_count):
print("P2PKH: m/0/"+str(x)+": " + (key/0/x).address('P2PKH'))
print("P2WPKH: m/0/"+str(x)+": " + (key/0/x).address('P2WPKH'))
print("P2WPKH-P2SH: m/0/"+str(x)+": " + (key/0/x).address('P2WPKH-P2SH'))
print("P2PKH: m/44./0./0./0/"+str(x)+": " + (key/44./0./0./0/x).address('P2PKH'))
print("P2WPKH: m/44./0./0./0/"+str(x)+": " + (key/44./0./0./0/x).address('P2WPKH'))
print("P2WPKH-P2SH: m/49./0./0./0/"+str(x)+": " + (key/49./0./0./0/x).address('P2WPKH-P2SH'))
print("P2PKH: m/49'/0'/0'/0/"+str(x)+": " + (key/49./0./0./0/x).address('P2PKH'))
print("P2WPKH: m/49'/0'/0'/0/"+str(x)+": " + (key/49./0./0./0/x).address('P2WPKH'))
print("P2WPKH-P2SH: m/49'/0'/0'/0/"+str(x)+": " + (key/49./0./0./0/x).address('P2WPKH-P2SH'))
print("P2PKH: m/84'/0'/0'/0/"+str(x)+": " + (key/84./0./0./0/x).address('P2PKH'))
print("P2WPKH: m/84'/0'/0'/0/"+str(x)+": " + (key/84./0./0./0/x).address('P2WPKH'))
print("P2WPKH-P2SH: m/84'/0'/0'/0/"+str(x)+": " + (key/84./0./0./0/x).address('P2WPKH-P2SH'))
all of these appear on the coldcard now, thanks. The one missing was m/0/x
from cryptotools.
Related Issues (20)
- Remove lxml from test suite
- It makes P2WSH not right. HOT 8
- How to install offline? HOT 1
- Problems installing cryptotools with pip HOT 2
- incomplete test instructions?! HOT 2
- multisig logic appears faulty HOT 4
- support for passphrases? HOT 1
- How to derive all possible segwit addresses from xpub HOT 3
- Litecoin support? Get address from Ltub? HOT 3
- ScriptValidationError: Unknown script type HOT 8
- Not working with pyinstaller HOT 2
- question
- Why doesn't this work on Private Key WIF compressed ? HOT 1
- BTC private keys to address and balance check HOT 2
- pls add support electrum v1 and v2
- Will this allow arbitrary/non-dictionary mnemonic seeds? HOT 2
- Need some advice. HOT 10
- 50000
- cant install with the command
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 cryptotools.