2

The following code, using ethjs-signer,

var privateKey = "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef";

var transaction = {
    "nonce": 0,
    "gasPrice": "230000000000",
    "gasLimit": "21000",
    "to": '0xFCAd0B19bB29D4674531d6f115237E16AfCE377c',
    "value": "1000000000000000000",
    "data": "0x0123abcd"
}


var ethjsSigner = require("ethjs-signer");
console.log(ethjsSigner.sign(transaction, privateKey));

Produce this signature:

0xf8708085358d117c0082520894fcad0b19bb29d4674531d6f115237e16afce377c880de0b6b3a7640000840123abcd1ba04e289b471dd4469d5080ce3726b8359d5b0c649e012bbbdde53f9b6580ad21a2a0333663ea96846c112f3878705c8c24a763d1fbf8f97c174d26e350c7ef0d7263

The same transaction on MyEtherWallet produces this signature:

0xf8708085358d117c0082520894fcad0b19bb29d4674531d6f115237e16afce377c880de0b6b3a7640000840123abcd25a032dbcf46a64b9892df24d8b961d2a52fd66b1dabd3a0d96940fd6795c01d8711a01b86df9475de7451554557d87b69456e3fa95aa5375584bf63d1ffd647a225d9

Why are those signatures different?

2

It appears the prior doesn't have the chainid which prevents transactions from being replayed on both chains. MyEtherWallet does.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.