Comments (5)
I can't figure out why... @kyledrake can you take a look at it?
from bitcoinjs-lib.
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.
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.
@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.
Resolved by #101
from bitcoinjs-lib.
Related Issues (20)
- Transfer BRC-20 tokens with bitcoinjs-lib HOT 1
- Can not sign for input #0 with the key HOT 2
- Can not sign for input #0 with the key
- Unable to broadcast transaction, even after validating the inputs HOT 4
- Transaction not broadcasting HOT 4
- internalPubkey seems to be a misnomer when committing to null merkle root of script tree HOT 2
- Switch from typeforce to something else HOT 10
- BRC-20 Support HOT 1
- Transaction sending failed (No script found for input #0) HOT 2
- Does bitcoinjs lib has instruments for creating MuSig key-path spend wallets with n-n scheme? HOT 10
- How do I consume a UTxO from a script based address (P2SH) HOT 2
- How should I test the `taproot.spec.ts` file in the project in my localy NodeJS, I got the error infomation below. Thanks very much. HOT 10
- Send a Transaction with SegWit P2PKH Keypair HOT 8
- TypeError: Argument must be a Buffer when signing input HOT 1
- Bitcoin build transaction HOT 3
- can not sign input with my keypair HOT 5
- How can I add derivation (or any other way to make the address be a new one each time)? HOT 7
- How can I create inscription psbt with this library? HOT 2
- Help with spending a custom script with Pay to Witness Script Hash HOT 3
- Taproot script-spend-path with sighash ALL|ANYONECANPAY HOT 8
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 bitcoinjs-lib.