Skip to content

Bug: Bankr eth_signTypedData_v4 signatures fail fxUSD EIP-3009 (Base) #199

@huwangtao123

Description

@huwangtao123

Summary

bankr sign --type eth_signTypedData_v4 produces signatures that recover to the expected address locally, but fail on-chain validation for fxUSD EIP-3009 transferWithAuthorization on Base (FiatTokenV2: invalid signature).

This blocks x402 premium payments at $0.01 fxUSD when Bankr is used as the EIP-712 signer.

Impact

  • x402 flow cannot settle payments when signature is produced via Bankr signer.
  • Integrations that rely on Bankr signing for EIP-3009 fail with simulation_failed / invalid signature.

Environment

  • Bankr CLI: latest from npm i -g @bankr/cli (as of 2026-02-26)
  • Network: Base (chainId=8453)
  • Token: fxUSD 0x55380fe7A1910dFf29A47B622057ab4139DA42C5
  • Flow: x402 premium payment to https://smartclaw.xyz/api/premium

Reproduction

  1. Get x402 402 payload from GET https://smartclaw.xyz/api/premium.
  2. Build EIP-3009 typed data from payment requirements:
    • domain: name=FxUSD, version=2, chainId=8453, verifyingContract=0x55380fe7A1910dFf29A47B622057ab4139DA42C5
    • primaryType: TransferWithAuthorization
    • message: from,to,value,validAfter,validBefore,nonce
  3. Sign with:
    • bankr sign --type eth_signTypedData_v4 --typed-data '<json>'
  4. Submit via x402 payment header (PAYMENT-SIGNATURE) and retry premium endpoint.

Actual Result

  • Server returns 402 with settlement error:
    • {"error":"Settlement failed","details":"simulation_failed"...}
  • Local simulation against token contract reverts with:
    • FiatTokenV2: invalid signature

Expected Result

  • Signature should be accepted by fxUSD transferWithAuthorization.
  • x402 settlement should complete and premium API should return business data.

Diagnostics Performed

  • Signature is parsed correctly from Bankr CLI output.
  • recoverTypedDataAddress matches signer address (local cryptographic recovery succeeds).
  • Signature is low-s canonical (not a high-s rejection case).
  • Domain parameters are confirmed correct against on-chain DOMAIN_SEPARATOR:
    • Match found for name=FxUSD, version=2, chainId=8453.
  • Despite above, contract verification fails (invalid signature).

Likely Area to Check

Potential mismatch in how Bankr constructs/serializes EIP-712 typed data for eth_signTypedData_v4 (field encoding/order/type normalization) versus what FiatTokenV2 expects for EIP-3009.

Request

Please prioritize a fix or provide a compatibility guideline/workaround for EIP-3009 on Base fxUSD.

If this is the wrong repository, please transfer this issue to the correct Bankr CLI/signing backend repo.

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