Skip to content

No way to mint API credentials for POLY_1271 deposit wallets — /auth rejects an ERC-7739-wrapped ClobAuth signature that the wallet itself validates on-chain #97

Description

@tlrktz

Summary

There appears to be no way to mint CLOB API credentials usable with POLY_1271 (deposit wallet) order signing. Orders built per this SDK carry signer = <deposit wallet> (required for on-chain ERC-1271 validation), and order submission enforces order.signer == api_key.address — but /auth/api-key and /auth/derive-api-key only accept plain EOA signatures, so every mintable key is EOA-bound. The result is that deposit-wallet accounts cannot trade through the API at all, even though new maker accounts are now required to use the deposit wallet flow ("maker address not allowed, please use the deposit wallet flow").

This is the same underlying gap as #65, but with new evidence isolating it to the auth service (details below).

What I tried

Environment: https://clob.polymarket.com, chain id 137, deposit wallet deployed via the relayer (WALLET-CREATE) and funded; /balance-allowance correctly reports the collateral and exchange allowances for the deposit wallet.

  1. EOA-bound key + POLY_1271 order (the SDK default): rejected with 400 {"error":"the order signer address has to be the address of the API KEY"}. Expected, given the key is bound to the EOA while order.signer is the deposit wallet.

  2. /auth/derive-api-key with POLY_ADDRESS = <deposit wallet> and a plain EOA signature over ClobAuth (the EIP-712 payload unchanged, address field set to the deposit wallet): rejected with 400 {"error":"Invalid L1 Request headers"}.

  3. /auth/derive-api-key with POLY_ADDRESS = <deposit wallet> and an ERC-7739 TypedDataSign-wrapped signature, constructed exactly like this SDK's POLY_1271 order signing path (outer digest under the app domain — ClobAuthDomain, version 1, chainId 137; TypedDataSign value carrying contents = ClobAuth message, name = "DepositWallet", version = "1", chainId, verifyingContract = <deposit wallet>, salt = 0x0; final signature bytes innerSig ‖ appDomainSeparator ‖ contentsHash ‖ contentsTypeString ‖ uint16(len)): also rejected with 400 {"error":"Invalid L1 Request headers"}.

The key evidence

Before submitting attempt 3, I verified the wrapped signature on-chain against the deposit wallet itself:

eth_call → depositWallet.isValidSignature(clobAuthEip712Digest, wrappedSignature)
→ 0x1626ba7e  (ERC-1271 magic value: VALID)

So the ERC-7739 envelope is exactly what the deposit wallet's validator accepts, and the rejection has to be happening in the auth service before (or instead of) any ERC-1271 check — it appears to ecrecover only, which a contract wallet can never satisfy.

Questions

  1. Is minting API credentials bound to a deposit wallet supported today? If yes, what request format does the auth service expect (it is not the ERC-7739 envelope the wallets themselves validate, per the above)?
  2. If not supported yet, is a backend change planned? As it stands, POLY_1271 is mandatory for new maker accounts but unusable via the API, which also affects BUG - V2 - Create ApiKey() doesn't EIP-1271-wrap L1 auth for POLY_1271 deposit wallets — orders always rejected with signer != api_key #64 100% server-side order cancellation on POLY_1271 deposit wallet — all client-side causes ruled out #70 Missing chain URL for transport when creating a wallet client #71 POLY_1271 deposit wallet orders rejected: API keys remain EOA-bound despite funderAddress #75 new metamask account(20260512 registered) failed with redeem through API #77 on the Python client.
  3. If there is an intended interim path (e.g. UI-issued keys being deposit-wallet-bound), documenting it would unblock a lot of people.

Happy to provide a full runnable repro script privately if useful.

Activity

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

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