Code Monkey home page Code Monkey logo

Comments (6)

marvinroger avatar marvinroger commented on June 16, 2024 2

Alright, so it's a bit more complicated than that.

We can't generate a nano seed from a BIP39 mnemonic phrase. We can however derive private keys from the mnemonic phrase with the BIP39 derivation path 44'/165'/0', 0 being the account index.

See https://github.com/nanocurrency/nano-node/wiki/Mnemonic-Seed

from nanocurrency-js.

rokanost avatar rokanost commented on June 16, 2024

I generate my seed with:

 let seedBuffer = bip39.mnemonicToSeed(MNEMONIC_PRIVATE_SEED);
 let seed = Buffer.from(seedBuffer).toString('hex');

However, in new version checkSeed() is failing.
The length of my seed is 128 characters and maximum allowed for deriveSecretKey() is 64 :/

from nanocurrency-js.

marvinroger avatar marvinroger commented on June 16, 2024

@rokanost what if you comment that line?

if (!checkSeed(seed)) throw new Error('Seed is not valid');

If it's as simple as feeding the blake2b hash with a 128 chars seed instead of a 64 one, it would be easy to be compatible.

from nanocurrency-js.

rokanost avatar rokanost commented on June 16, 2024

I did comment it out and everything seems fine, but tx now fails on publish with “bad work”

from nanocurrency-js.

marvinroger avatar marvinroger commented on June 16, 2024

Do you generate the work against the previous block hash? If this is the first block on the account chain, you have to use the account's public key.

from nanocurrency-js.

rokanost avatar rokanost commented on June 16, 2024

All good now, had a little bug in my code.

from nanocurrency-js.

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.