Comments (6)
Hi, I have to add it. If it is like the other coins built on Cosmos it shoud be pretty quick.
Regards,
Emanuele
from bip_utils.
Thanks for the quick reply!
That would be awesome.
from bip_utils.
Hello, I added Injective as a coin.
Please note that Injective uses a different algorithm for encoding the address with respect to other Cosmos-based coins, as you can see in the code snippet from their docs. So I added a specific address encoder/decoder just for it.
With my implementation, I get the same addresses of Cosmostation wallet, which I always use as reference for Cosmos-based coins.
I don't know if the cosmpy
library uses the Injective algorithm or just the standard Cosmos algorithm for encoding the address. I took a quick look and found no trace of it in the code. So, if you get different addresses with respect to cosmpy
it's because of that.
from bip_utils.
Hello,
Great and thanks a lot
This works as intended, although indeed when using Cosmpy the result is still wrong:
from cosmpy.aerial.wallet import LocalWallet
from cosmpy.crypto.keypairs import PrivateKey, PublicKey
bip44_mst_ctx = Bip44.FromSeed(seed_bytes, Bip44Coins.INJECTIVE)
bip44_acc_ctx = bip44_mst_ctx.Purpose().Coin().Account(0)
bip44_chg_ctx = bip44_acc_ctx.Change(Bip44Changes.CHAIN_EXT)
bip44_addr_ctx = bip44_chg_ctx.AddressIndex(0) #index 0 appears to be the right one here
print(bip44_addr_ctx.PublicKey().ToAddress()) # --> CORRECT ADDRESS
print(LocalWallet(PrivateKey(bip44_addr_ctx.PrivateKey().Raw().ToBytes()), prefix='inj')) #--> WRONG ADDRESS
I've ran a number of tests this morning but couldn't find a solution. I'll try some more and open an issue with the Cosmpy team if still no success.
from bip_utils.
That's because it uses the standard Cosmos algorithm, to get the same result with bip_utils
:
print(LocalWallet(PrivateKey(bip44_addr_ctx.PrivateKey().Raw().ToBytes()), prefix="inj"))
# Same address
print(AtomAddrEncoder.EncodeKey(
bip44_addr_ctx.PublicKey().Bip32Key().KeyObject(),
hrp="inj"
))
from bip_utils.
Indeed
I'll mention this in the issue.
from bip_utils.
Related Issues (20)
- Ed25519 missing variables, invalid escape sequence, atrribute error? HOT 2
- Typo
- Creating P2SH Addresses for Networks Without SegWit Support HOT 1
- pip install error HOT 5
- Dependencies upgrade? HOT 4
- bump pycryptodome version HOT 15
- Generate correct taproot addresses for both wallets HOT 7
- Building wheel for ed25519-blake2b (pyproject.toml) did not run successfully HOT 2
- Using alt extended public keys HOT 1
- solana address is wrong HOT 1
- Bug in generating Aptos addresses HOT 3
- Not generating correct BIP86 addresses for regtest HOT 7
- Derive BTC bip32 address from mnemonic HOT 3
- Hi could you help me with 2 questions? HOT 15
- Derive BCH legacy bip44 address from mnemonic HOT 2
- Тransaction Nimiq HOT 1
- Does anyone know how to generate a Bitcoin signet address? HOT 3
- Cosmos series, such as how to generate celestia address HOT 3
- Help add generate address TON HOT 2
- Celsestia doesn't work HOT 1
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 bip_utils.