Skip to content

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

Open
@bithalo

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions