Comments (9)
Ok, I see that function. Yes, It seems that we can not generate a testnet address there. I am not well versed in JS, but maybe we can define an overloaded function, and have another backend function on the ledger internal side, that allows us to pass in this flag. let me dig a bit more at what we have internally, and how we can overcome this issue.
from ledger-stacks.
To add to this, I don't believe I'm able to generate testnet address even with the testnet path. Using m/44'/1'/0/0/0
still returns mainnet addresses.
from ledger-stacks.
Hi @kyranjamie. so if I understood well, we want to generate a testnet address for any derivation path. Your idea is passing a flag for such a case, right? can you elaborate a bit more?
from ledger-stacks.
Hi @neithanmo, yeah that's pretty much it. From a consumer point of view:
Here's what we have now:
sign(path: string, message: Buffer): ResponseSign
here's what we're after
sign(path: string, network: 'testnet' | 'mainnet', message: Buffer): ResponseSign
Stacks doesn't follow BIP-44 exactly, which is why we need this behaviour.
from ledger-stacks.
This flag or network information is already part of the transaction structure,, isn't it?
so with this new flag, should we ignore the one in the transaction?
from ledger-stacks.
Good point. If we can infer chain from the tx, and keep the API as it is now, that would be great.
from ledger-stacks.
I think, this line sets the transaction version number. I did the next two experiments:
- const network = StacksTestnet, and same derivation path
I got:
then:
Not sure If this is the expected behavior. I guess ST stands for testnet and SP for mainnet ??
from ledger-stacks.
Sorry @neithanmo sign
wasn't particularly demonstrative of this issue.
Consider the address generation methods, such as showAddressAndPubKey
. Currently it only accepts a derivation path. Ideally we need a signature like showAddressAndPubKey(path: string, network: 'testnet' | 'mainnet')
.
from ledger-stacks.
as an update. #55 is a wip that addresses this.
from ledger-stacks.
Related Issues (20)
- Wrong/unknown error code for `AppDoesNotSeemToBeOpen`
- Support JWT signing for Stacks authentication HOT 5
- Unable to retrieve keys for `m/888'` derivations paths
- Publish js app `v0.22.3` HOT 1
- Update data key derivation path HOT 1
- NPM published version is different than github HOT 2
- Display Domain name when signing JWT messages HOT 1
- Structured message signing support HOT 7
- Issues signing `principalCV` clarity types HOT 2
- Adjust `Stacks Signed Message` length prefix HOT 1
- Use varuint encoding for message prefix HOT 2
- Rename & publish npm package under `@zondax/ledger-stacks` HOT 2
- Replace buffer usage with Uint8Array HOT 1
- Message signing: payloads not accepted, line break issues HOT 3
- Contract principal not displayed properly on Ledger screen HOT 4
- Ledger Nano S screen showing incorrect address (40 instead of 41 characters) HOT 4
- Reduce the app size
- Fix CI HOT 1
- Update zxlib HOT 1
- Add new S+ sdk 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 ledger-stacks.