Giter VIP home page Giter VIP logo

Comments (5)

weilu avatar weilu commented on August 26, 2024

I can't figure out why... @kyledrake can you take a look at it?

from bitcoinjs-lib.

tgerring avatar tgerring commented on August 26, 2024

Picking this apart, it looks like the error is occurring in JSBN. Here's my stacktrace:

Error: Point is not on the curve.
    at ECPointFp.validate (/Users/tgerring/dev/tgerring/bitcoinjs-lib/src/jsbn/ec.js:508:11)
    at Object.ECDSA.recoverPubKey (/Users/tgerring/dev/tgerring/bitcoinjs-lib/src/ecdsa.js:261:7)
    at Object.ECDSA.calcPubkeyRecoveryParam (/Users/tgerring/dev/tgerring/bitcoinjs-lib/src/ecdsa.js:297:26)
    at Object.Message.signMessage (/Users/tgerring/dev/tgerring/bitcoinjs-lib/src/Message.js:36:17)
    at Object.<anonymous> (/Users/tgerring/dev/tgerring/bitcoinjs-lib/demo/taylor.js:9:17)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)

for the given code run out of /demo:

var ECKey = require('../src/eckey.js');
var Network = require('../src/Network.js');
var Message = require('../src/Message.js');

startTimeMs = Date.now();
var v = new ECKey.ECKey(null, true, Network.testnet.addressVersion);
console.log(v);
var r = Message.signMessage(v, "testing 123", v.compressed);
console.log(r);
endTimeMs = Date.now();
console.log('Operation took', endTimeMs - startTimeMs, 'ms');

from bitcoinjs-lib.

tgerring avatar tgerring commented on August 26, 2024

Digging more, it looks like the initial error is being thrown in ECDSA.verifyRaw()

Note that https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/src/ecdsa.js#L123-L125 contains a message about Shamir's trick not working, yet it is used at https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/src/ecdsa.js#L269.

In the end, https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/src/ecdsa.js#L131 evaluates to false for testnet, but works for mainnet.

from bitcoinjs-lib.

robby-dermody avatar robby-dermody commented on August 26, 2024

@weilu @kyledrake FYI, our new wallet, which uses bitcoinjslib is released in beta on testnet:

https://www.counterparty.co/counterwallet-live-testnet/
https://testnet.counterwallet.co

Thank you guys for this library!

from bitcoinjs-lib.

weilu avatar weilu commented on August 26, 2024

Resolved by #101

from bitcoinjs-lib.

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.