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

web3.js no way to sign a transaction offline #7427

Open
bithalo opened this issue Dec 18, 2024 · 0 comments
Open

web3.js no way to sign a transaction offline #7427

bithalo opened this issue Dec 18, 2024 · 0 comments

Comments

@bithalo
Copy link

bithalo commented Dec 18, 2024

Expected behavior

web3.eth.accounts.signTransaction(transaction, privateKey);
does not let you sign a transaction when chainId, nonce and gasLimit and gasPrice are supplied when offline

Actual behavior

It just throws an error about whatever you did to initialize the web3 instance (which cannot be blank) for example if one connects to ankr essentially it's saying it would not connect to them and fails.
This is unacceptable for a half trillion dollar project... offline signing is the only safe way to sign and should be the industry
standard. But yet it is so desperate to perform some online checks in the wrong function that it throws an error.

Trying to hold back some intense frustration. How many thousands of contributors, will they recommend "oh use a different library for that"... ridiculous.

Steps to reproduce the behavior

  1. Turn off your wifi
  2. Sign some TX object
  3. FAIL

It should work out of the box and I read through all documentation and spent a few hours googling which is more and more thin with results day by day. Running out of options here don't tell me I have to digest everything manually?!

Recommendation... don't throw an error, try to actually sign the object, don't attempt to pull or check for information that is already in your TX object or to validate or allow a flag for offline signing.

Environment

web3 version 0.5.7... assuming it's the same in all versions correct me if this isn't the case
Vanilla JS

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