GithubHelp home page GithubHelp logo

Comments (9)

neithanmo avatar neithanmo commented on May 27, 2024 1

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.

kyranjamie avatar kyranjamie commented on May 27, 2024

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.

neithanmo avatar neithanmo commented on May 27, 2024

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.

kyranjamie avatar kyranjamie commented on May 27, 2024

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.

neithanmo avatar neithanmo commented on May 27, 2024

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.

kyranjamie avatar kyranjamie commented on May 27, 2024

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.

neithanmo avatar neithanmo commented on May 27, 2024

I think, this line sets the transaction version number. I did the next two experiments:

  • const network = StacksTestnet, and same derivation path
    I got:
    image

then:

  • const network = StacksMainnet(), keep using the same path at it is in the example, and got:
    image

Not sure If this is the expected behavior. I guess ST stands for testnet and SP for mainnet ??

from ledger-stacks.

kyranjamie avatar kyranjamie commented on May 27, 2024

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.

neithanmo avatar neithanmo commented on May 27, 2024

as an update. #55 is a wip that addresses this.

from ledger-stacks.

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.