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

The signTransaction method does not work correctly. #1793

Closed
zuart opened this issue Jul 25, 2018 · 5 comments
Closed

The signTransaction method does not work correctly. #1793

zuart opened this issue Jul 25, 2018 · 5 comments
Assignees
Labels
Bug Addressing a bug
Projects

Comments

@zuart
Copy link

zuart commented Jul 25, 2018

Input:
oTX:
{
"to": "0xed32e0fd016810B7d3606e1Ae163B58266c544B0",
"gasLimit": "0xc350",
"value": "0x2386f26fc10000",
"chainId": "0x01",
"gasPrice": "0x4a817c800",
"nonce": "0x4"
};
var key = "9cb1 ... 2a84";

Method 1 - OK:
var _key = new Buffer(key, 'hex');
var _tx = new TX(tx);
_tx.sign(_key);

var _raw = _tx.serialize();
var _rr = '0x' + _raw.toString('hex');

:: HASH1 = '0xf86b ... 25a00b3b ... 7f39';

Method 2 - ERR:
web3.eth.signTransaction(tx, key).then(trans);

:: HASH2 = '0xf86b ... 25a009fd ... 08b5';

And the description of the method signTransaction in the documentation does not correspond to the actual result.

@nivida nivida self-assigned this Aug 10, 2018
@nivida nivida added the Bug Addressing a bug label Aug 10, 2018
@nivida nivida added the In Progress Currently being worked on label Aug 20, 2018
@takahser
Copy link

I had the same error as in #1986 when using signTransaction. Rolling back to "web3": "1.0.0-beta.34" fixed it for me.

3 similar comments
@takahser
Copy link

I had the same error as in #1986 when using signTransaction. Rolling back to "web3": "1.0.0-beta.34" fixed it for me.

@takahser
Copy link

I had the same error as in #1986 when using signTransaction. Rolling back to "web3": "1.0.0-beta.34" fixed it for me.

@takahser
Copy link

I had the same error as in #1986 when using signTransaction. Rolling back to "web3": "1.0.0-beta.34" fixed it for me.

@nivida nivida removed the In Progress Currently being worked on label Nov 28, 2018
@nivida nivida added this to To do in 1.0 Nov 28, 2018
@dileepfrog
Copy link

dileepfrog commented Mar 21, 2019

I have also just verified this problem - it seems that chainId is not being properly encoded. In my case, I'm using a private network with chainId of 4 decimal digits, which seems to be causing the issue. When using ethereumjs-tx to sign and RLP encode identical arguments, the tx sends successfully.

Rolling back to "web3": "1.0.0-beta.37" fixes this issue.

@nivida nivida mentioned this issue Mar 26, 2019
12 tasks
@nivida nivida closed this as completed Mar 27, 2019
1.0 automation moved this from To do to Done Mar 27, 2019
@nivida nivida mentioned this issue Mar 28, 2019
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug
Projects
No open projects
1.0
  
Done
Development

No branches or pull requests

4 participants