WalletConnect developer notes
IDN Wallet is a WalletConnect Sign v2 wallet built on a pinned reown-swift 2.4.0 (Sign modules only). Its support is deliberately narrow: IDN Network only, three methods, strict formats. Requests that break the format rules are refused without being shown to the user; a few checks (for example token in the asset list, non-zero amount, verified backup) run only after the user taps continue, and fail with 4001.
Summary
| Protocol | WalletConnect Sign v2 (pairing links must be wc:…@2?…) |
|---|---|
| Chain | eip155:215 only (IDN Network, hex 0xd7) |
| Account | Exactly one per session: the user's currently selected account, as eip155:215:<address> with the address in lowercase hex |
| Methods | eth_sendTransaction, personal_sign, eth_signTypedData_v4 |
| Events | accountsChanged and chainChanged can be part of an approved session, but the wallet never emits them |
| Not supported | eth_sign, eth_signTypedData (v1/v3), eth_signTransaction, eth_sendRawTransaction, eth_accounts, eth_requestAccounts, eth_chainId, wallet_switchEthereumChain, wallet_addEthereumChain and read-only RPC calls; one-click auth (wc_sessionAuthenticate); Link Mode; Universal Links |
| Wallet metadata | name IDN Wallet; description IDN mainnet self-custody wallet; url https://wallet.idnchain.com; empty icons; native redirect idnwallet://wc (do not rely on it to return to the wallet; see below) |
Pairing
- QR code: the user taps Scan to connect (扫码连接) on the wallet's Connect (连接) tab, scans your QR code, taps the connect-and-check button (连接并核对网站), then approves the proposal with Allow connection (允许连接). Nothing pairs automatically. This path has been tested on an iPhone.
- Pasted link: the user can paste a
wc:link on the Connect (连接) tab. Implemented, not yet tested on an iPhone. - Deep links: the wallet does not register
wc:with iOS (onlyidnwallet://).idnwallet://wc?uri=…only fills in the link when the wallet is already unlocked and in the foreground; opened from a browser or another app, the wallet is normally locked and the link is dropped. Offer a QR code; do not depend on deep links.
Pairing link rules:
- Only
symKey(64 hex characters, required),relay-protocol=irn(required), and optionallyrelay-data,expiryTimestampandmethods; no#; at most 4096 bytes. expiryTimestampmust be in the future and no more than 600 seconds ahead. Without it, the deadline is 5 minutes after the user taps the connect button. Either way, your proposal must arrive and be approved before the deadline.- If
methodsis present it must be exactlywc_sessionPropose. Links that offer one-click auth are refused. A proposal that carries arequestsfield (for examplerequests.authenticationfor one-click auth) is rejected as a whole (5000).
Session proposals
- The wallet only accepts a proposal from the pairing the user just completed (the same pairing topic). Each connection needs a fresh QR code or link; a later proposal over an old pairing is rejected.
- Required namespaces must be
eip155with chains exactly["eip155:215"], oreip155:215. Any other required chain (even alongsideeip155:215), any non-EVM namespace, or any unsupported required method or event rejects the whole proposal. - Optional namespaces are trimmed silently: only supported methods and events from an
eip155entry whose chains includeeip155:215, or from aneip155:215entry, are kept. Every optional namespace, including ones the wallet ignores (such assolana), must still pass a shape check: at most 8 namespaces; at most 16 chains, 32 methods and 16 events each; method and event names of 1–64 letters, digits or underscores. If any check fails, the whole proposal is rejected (5000). Multi-network DApps should watch the 16-chain limit. - Your metadata
urlmust behttpswith a valid host name.http(includinghttp://localhost) is rejected.namemust be 1–80 characters. - The user has at most 2 minutes to approve. Every rejection uses the SDK reason
userRejected(code 5000).
Example (required namespaces):
{
"eip155": {
"chains": ["eip155:215"],
"methods": ["eth_sendTransaction", "personal_sign"],
"events": []
}
}
eth_sendTransaction
paramsmust be an array holding exactly one object with onlyfrom,to,value,dataandchainId. Any other key —gas,gasPrice,nonce,maxFeePerGas,maxPriorityFeePerGas,type,accessList,inputand so on — is refused (4100).frommust equal the session account.tomust not be the zero address (no contract creation). Addresses may be all lowercase, all uppercase or correct EIP-55.chainIdis optional; if present it must be the string"0xd7".valueis optional and defaults to 0; if present it must be a canonical hex string (0xprefix, no leading zeros, e.g."0x0","0xde0b6b3a7640000"). Numbers and decimal strings are refused.- Omitting
data, or sending"0x", means an IDN transfer (an empty string""is refused). Otherwise it must be one canonical ERC-20transfer(address,uint256)(selector0xa9059cbb, 68 bytes, non-zero recipient) withvalue0.approveand every other contract call are refused. - The token must already be in the user's asset list (tokens the user has hidden count too). Zero-amount transfers fail (4001).
- The wallet chooses the nonce, gas price and gas limit, and signs a legacy (EIP-155) transaction for chain ID 215.
- The user confirms twice (the request, then a full preview) and authenticates with Face ID, Touch ID or the device passcode. Once the wallet has signed the transaction and started sending it to a node, you receive the transaction hash, even if the node returned an error or did not reply. A hash does not prove the node accepted the transaction; check the chain.
[{
"from": "<session account>",
"to": "<recipient>",
"value": "0xde0b6b3a7640000",
"chainId": "0xd7"
}]
personal_sign (SIWE only)
paramsis[message, address].messagemust be0xhex of UTF-8 bytes, at most 8192 bytes; plain-text messages are refused.addressmust equal the session account.- Only a strict Sign-In with Ethereum (ERC-4361) message is accepted, and your origin must pass Verify (see below). Anything else is refused (4100).
- Line 1:
<domain> wants you to sign in with your Ethereum account:, where the domain equals the verified https origin (no path). - Line 2: the address in exact EIP-55 checksum form (all lowercase is refused, even though the session account is lowercase).
- Then, in order:
URI(same https origin),Version: 1,Chain ID: 215,Nonce(8–64 letters or digits),Issued At, and a requiredExpiration Time; optionallyNot Before,Request IDandResources(at most 10, same origin). Printable ASCII and LF line breaks only, 10–30 lines. Expiration Timemust be afterIssued At, at most 15 minutes after it, and still in the future.Issued Atmust be no more than 5 minutes old and no more than 60 seconds in the future. A nonce already used for the same origin and address is refused until it expires.- The result is a 65-byte EIP-191 signature (v is 27 or 28).
example.com wants you to sign in with your Ethereum account:
0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed
Sign in to Example.
URI: https://example.com
Version: 1
Chain ID: 215
Nonce: 8f3k2LmQ
Issued At: 2026-11-05T10:00:00Z
Expiration Time: 2026-11-05T10:10:00Z
eth_signTypedData_v4 (ERC-2612 Permit only)
paramsis[address, typedData], andtypedDatamust be a JSON string. Your origin must pass Verify.primaryTypemust bePermit.typesmay hold onlyEIP712Domain(name, version, chainId, verifyingContract; no salt) andPermit(owner, spender, value, nonce, deadline, in that order).chainIdmust be 215,ownermust be the session account,spenderandverifyingContractmust be non-zero, anddeadlinemust be in the future.- Before signing, the wallet reads the token's
DOMAIN_SEPARATOR()andnonces(owner)on-chain and requires them to match, and reads the current allowance. The user must tick a risk acknowledgement and authenticate with Face ID, Touch ID or the device passcode. - Permit2 and all other typed data are refused.
Origin verification (Verify)
| Verify result | Proposals, eth_sendTransaction | personal_sign, eth_signTypedData_v4 |
|---|---|---|
| Valid, and the origin equals the https origin of your metadata url | Allowed | Allowed |
| Unknown (no result) | Allowed, with a prominent "source not yet verified" (来源尚未验证) warning to the user | Refused (4100) without a prompt |
| Invalid, scam, or an origin different from your metadata url | Refused | Refused |
The wallet applies this table to every request, but the Verify result it sees is the one the SDK recorded when the session was connected; this SDK version does not verify each request again. A session that connected from an unverified origin therefore cannot use SIWE or Permit for its whole lifetime, and a later change in Verify does not affect an existing session. When verification passes, the wallet shows "source verified" (来源验证已通过) and reminds the user that a verified source does not make the request content safe.
Error codes and deliberate silence
| Code | Message | When |
|---|---|---|
| 4100 | Request not authorized or unsupported | The request reached the wallet and failed its checks: wrong account, malformed or oversized params, a malformed request ID, origin not acceptable, SIWE nonce already used, rate limit, session already revoked in the wallet, or the wallet busy with a proposal or another confirmation |
| 4001 | User rejected or authorization expired | The user cancelled; the user tapped continue after the local approval window ran out (the wallet sends nothing on its own when the window ends); or it failed after approval (insufficient balance, zero amount, an earlier transaction from this account still unresolved, token not in the asset list, backup not verified, the token's on-chain DOMAIN_SEPARATOR() or nonces(owner) not matching the Permit, authentication (Face ID, Touch ID or passcode) cancelled, node error) when no transaction can have been sent and no signature handed over |
| 4001 | Wallet authorization revoked | The wallet locked or went to the background while the request was on screen. Sent after the user unlocks and the relay reconnects |
| 5000 | User rejected (SDK) | Every rejected proposal |
| 6000 | The SDK's disconnect message | The wallet ended the session (user action or account switch) |
| 14001 | Auth request rejected by the user (SDK) | A one-click auth request arrived |
Some requests never reach the wallet and the SDK answers them: a method or chain not approved in the session gets 3001 (3005 for a non-eip155 chain), and an already expired request gets 8000.
If your expiryTimestamp passes before the wallet answers (while the request is waiting behind another one or on screen, or while the wallet is locked or in the background), the SDK drops the request: you get no answer from the wallet (not even Wallet authorization revoked), or only the SDK's 8000. For eth_sendTransaction, if the wallet had already started sending the transaction to a node, you still get only 8000 or nothing; neither means the transaction was not sent, so check the chain. After you disconnect the session, the wallet's answer cannot be sent either.
Do not reuse request IDs: if the ID matches a request still pending in the SDK (in any session), the SDK drops the new one without answering; if it matches one already answered, the wallet may re-send the earlier error, stay silent, or answer 4100.
Sometimes the wallet stays silent on purpose. If a transfer confirmation was already running (the transaction may have been broadcast), or a signature was already handed to the transport without confirmed delivery, the wallet will not send a later "rejected" that could contradict what happened. No answer does not mean "not sent". Check the chain.
When the SDK re-delivers a request the wallet already answered with an error, the wallet re-sends the same error without evaluating it again.
Sessions and limits
- Sessions last at most 7 days and are never extended. After that, connect again.
- Sessions are not restored after an App restart; the user scans again. Earlier sessions are not told they ended.
- Lock or background: the request or proposal on screen is cancelled and the relay connection pauses; sessions for the same account are kept and work again after unlock.
- Switching account or wallet disconnects the sessions bound to the old account.
- One request or proposal at a time. Each request gets a local approval window of at most 120 seconds, never later than your
expiryTimestampor the session expiry. - At most 16 sessions; at most 60 proposals and requests together per 60 seconds;
paramsJSON at most 32768 bytes; request IDs are integers from 0 to 253−1 or strings of 1–128 ASCII characters from 0x21 to 0x7E (no spaces). Never reuse a request ID, not even across sessions (see above).
What has been tested
On 5 and 7 November 2026 the development team checked, on one iPhone (iOS 26.6.1) with development builds, against an internal test app running in the iOS simulator with the same SDK: QR pairing; approving a session with only eip155:215 and one account; cancelling a 0 IDN transfer request (4001); automatic refusal of SIWE from an unverified origin (4100); locking the phone while a request was showing, answered with 4001 Wallet authorization revoked after unlock; and a DApp-side disconnect. These checks have not yet been repeated on the TestFlight beta.
Not yet tested on a device: SIWE and Permit signing from a verified origin; on-chain transactions over WalletConnect; recovering after network loss; what happens to an existing session after an App restart; pairing from a pasted link or a deep link; real web DApps (AppKit, wagmi and others).
Most rules in the wallet's domain policy (pairing links, namespaces, parameter formats, SIWE, Permit, Verify decisions) are covered by automated tests on a Mac, though not every limit has its own test. The App-level behaviour (error codes and messages, deliberate silence, re-sent errors, the SDK's 5000/14001/6000 answers, deep links, the two confirmations) has no automated tests; only part of it was checked in the device run above.
Using the WalletConnect protocol does not imply any partnership with, or certification by, WalletConnect or Reown.