You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
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.
/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"}.
/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:
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
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)?
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 enforcesorder.signer == api_key.address— but/auth/api-keyand/auth/derive-api-keyonly 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-allowancecorrectly reports the collateral and exchange allowances for the deposit wallet.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 whileorder.signeris the deposit wallet./auth/derive-api-keywithPOLY_ADDRESS = <deposit wallet>and a plain EOA signature overClobAuth(the EIP-712 payload unchanged,addressfield set to the deposit wallet): rejected with400 {"error":"Invalid L1 Request headers"}./auth/derive-api-keywithPOLY_ADDRESS = <deposit wallet>and an ERC-7739TypedDataSign-wrapped signature, constructed exactly like this SDK's POLY_1271 order signing path (outer digest under the app domain —ClobAuthDomain, version1, chainId 137;TypedDataSignvalue carryingcontents = ClobAuth message,name = "DepositWallet",version = "1",chainId,verifyingContract = <deposit wallet>,salt = 0x0; final signature bytesinnerSig ‖ appDomainSeparator ‖ contentsHash ‖ contentsTypeString ‖ uint16(len)): also rejected with400 {"error":"Invalid L1 Request headers"}.The key evidence
Before submitting attempt 3, I verified the wrapped signature on-chain against the deposit wallet itself:
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
ecrecoveronly, which a contract wallet can never satisfy.Questions
Happy to provide a full runnable repro script privately if useful.