Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transacation #50

Open
oaww opened this issue Feb 18, 2019 · 1 comment
Open

Transacation #50

oaww opened this issue Feb 18, 2019 · 1 comment

Comments

@oaww
Copy link

oaww commented Feb 18, 2019

in public test net when TransactionBuilder finalize in Signature.js,when nonce = 1,it will occur Error
nonce = 0;
e = _bigi2.default.fromBuffer(buf_sha256);
while (true) {
ecsignature = (0, _ecdsa.sign)(secp256k1, buf_sha256, private_key.d, nonce++); //here
der = ecsignature.toDER();
lenR = der[3];
lenS = der[5 + lenR];
if (lenR === 32 && lenS === 32) {
i = (0, _ecdsa.calcPubKeyRecoveryParam)(secp256k1, e, ecsignature, private_key.toPublicKey().Q);
i += 4; // compressed
i += 27; // compact // 24 or 27 :( forcing odd-y 2nd key candidate)
break;
}
if (nonce % 10 === 0 && process.env.ENVIRONMENT === 'DEV') {
console.log("WARN: " + nonce + " attempts to find canonical signature");
}
}

in ecdsa.js will always occur error

function deterministicGenerateK(curve, hash, d, checkSig, nonce) {

(0, _enforce_types2.default)('Buffer', hash);
(0, _enforce_types2.default)(_bigi2.default, d);

if (nonce) {
    hash = (0, _hash.sha256)(Buffer.concat([hash, Buffer.from(nonce)])); **//here**
}

// sanity check
_assert2.default.equal(hash.length, 32, 'Hash must be 256 bit');

var x = d.toBuffer(32);
var k = Buffer.alloc(32);
var v = Buffer.alloc(32);
@oaww
Copy link
Author

oaww commented Feb 19, 2019

some account will occur,some account not, ex: public-account-1 will
but i create an account:
name: in-oawwoaww6
private key: 5KQ4GsMP4N6NwtaHqBYvmAq5PwUQPsJB299xk5e6n5j36v6kreo
public key: DCT7UDjcPUGToUNUmUFG4svw3KxSHvDUeYMrbZUF5HcqwyVvBSk3J
will not occur

@oaww oaww closed this as completed Feb 19, 2019
@oaww oaww reopened this Feb 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant