Git Product home page Git Product logo

Comments (4)

paulmillr avatar paulmillr commented on June 16, 2024

not sure what are you talking about, they both are 33b.

> (await import('@noble/curves/secp256k1')).secp256k1.getPublicKey(new Uint8Array(32).fill(1))
Uint8Array(33) [
    3,  27, 132, 197,  86, 123,  18, 100,
   64, 153,  93,  62, 213, 170, 186,   5,
  101, 215,  30,  24,  52,  96,  72,  25,
  255, 156,  23, 245, 233, 213, 221,   7,
  143
]

> (await import('@noble/secp256k1')).getPublicKey(new Uint8Array(32).fill(1))
Uint8Array(33) [
    3,  27, 132, 197,  86, 123,  18, 100,
   64, 153,  93,  62, 213, 170, 186,   5,
  101, 215,  30,  24,  52,  96,  72,  25,
  255, 156,  23, 245, 233, 213, 221,   7,
  143
]

from noble-secp256k1.

telamon avatar telamon commented on June 16, 2024

@paulmillr Sorry i was zoomed in, but that is weird...
I can check which version of curves i migrated from but I am positive getPublickKey() used to return out 32byte keys (without the id byte).
Closing the issue.

from noble-secp256k1.

paulmillr avatar paulmillr commented on June 16, 2024

schnorr.getPublicKey returns 32 bytes

from noble-secp256k1.

telamon avatar telamon commented on June 16, 2024

@paulmillr i finally figured it out.. In the first example I was using the schnorr scheme from @noble/curves which indeed are 32bytes.
Hence my original description is wrong, should have been: (@noble/curves/secp256k1).schnorr.getPublicKey(sk)
Apologies for the noise and thx for the help.

from noble-secp256k1.

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.