Skip to content

KYC upload fails on Apothem with Private Key/Mnemonic: EIP-155 transaction required #65

Description

@loglapa

Description

Uploading a KYC document through the Apothem Masternode dashboard fails when the user is logged in using the Private Key/Mnemonic provider.

The RPC rejects the transaction with the following error:

only replay-protected (EIP-155) transactions allowed over RPC

Environment

Steps to reproduce

  1. Open https://master.apothem.network/.
  2. Log in using Private Key/Mnemonic with a funded owner account.
  3. Click Become a candidate.
  4. Select a valid PDF KYC document.
  5. Click Upload KYC.
  6. Observe the error notification.

Actual result

The dashboard displays:

An error occurred while uploading KYC. only replay-protected (EIP-155) transactions allowed over RPC

The RPC rejects the uploadKYC transaction and no KYC record is written to the validator contract.

Expected result

The dashboard should sign and submit an EIP-155 replay-protected transaction for Apothem chain ID 51, and display the resulting transaction hash or successful KYC status.

Technical analysis

The current uploadKYC implementation constructs the transaction parameters without a chainId:

const txParams = {
    from: account,
    gasPrice: self.web3.utils.toHex(self.gasPrice),
    gas: self.web3.utils.toHex(gas)
}

Source:

const txParams = {
from: account,
gasPrice: self.web3.utils.toHex(self.gasPrice),
gas: self.web3.utils.toHex(gas)
}

The Private Key/Mnemonic provider therefore appears to sign a legacy, non-EIP-155 transaction. Apothem RPC rejects such transactions.

The propose flow in the same component already includes:

chainId: self.chainConfig.networkId

Suggested fix

Include the configured network chain ID in the uploadKYC transaction:

const txParams = {
    from: account,
    gasPrice: self.web3.utils.toHex(self.gasPrice),
    gas: self.web3.utils.toHex(gas),
    chainId: self.chainConfig.networkId
}

It would also be useful to add regression tests for both Private Key and Mnemonic login providers on Apothem.

Additional note

PR #60 was intended to resolve KYC upload with a private key, but the current transaction parameters still do not contain chainId:

#60

Metadata

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