Skip to content

feat(sdk-coin-eth): add ERC-7984 confidential token non-BitGo recovery - #9411

Open
hrishikeshjain wants to merge 1 commit into
masterfrom
CHALO-1115
Open

feat(sdk-coin-eth): add ERC-7984 confidential token non-BitGo recovery#9411
hrishikeshjain wants to merge 1 commit into
masterfrom
CHALO-1115

Conversation

@hrishikeshjain

Copy link
Copy Markdown
Contributor

Summary

  • Implements ERC-7984 no-proof handle sweep recovery using sendMultiSig with ETHER prefix (not sendMultiSigToken/ERC20 prefix)
  • Adds queryConfidentialBalance() to query encrypted balance handles via eth_call on-chain
  • Overrides setGasLimit() with 800k default (validated ~530k actual usage on Hoodi testnet across 3 successful test transactions)
  • Guards against TSS recovery (not yet supported)

Key design decisions

Decision Rationale
No zero-handle check confidentialBalanceOf returns non-zero handles even for zero balances (encrypted domain)
sendMultiSig not sendMultiSigToken Operation hash needs ETHER prefix with bytes calldata, not ERC20 prefix with token address
800k gas limit Comfortable buffer over observed 506-530k gas usage on Hoodi
No Zama relayer integration Balance handle works directly as the transfer amount

Files changed

  • modules/abstract-eth/src/abstractEthLikeNewCoins.ts — Add encryptedHandle option to RecoverOptions
  • modules/sdk-coin-eth/src/erc7984Token.ts — Override recover(), add queryConfidentialBalance(), override setGasLimit()
  • modules/sdk-coin-eth/test/unit/erc7984Token.ts — Unit tests for recovery, balance query, and gas limit

Test plan

  • Unit tests for recover() signed, unsigned sweep, and KRS paths
  • Unit tests for queryConfidentialBalance() success and error cases
  • Unit tests for setGasLimit() default and override
  • Validated on Hoodi testnet with 3 successful recovery transactions (0x4149...4d3c, 0x79a6...d8ad, 0x35a9...4bce)

TICKET: CHALO-1115

Made with Cursor

@hrishikeshjain
hrishikeshjain requested a review from a team as a code owner August 4, 2026 11:11
@linear-code

linear-code Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

CHALO-1115

Implements the no-proof handle sweep for ERC-7984 tokens using
sendMultiSig with ETHER prefix and bytes calldata (not sendMultiSigToken).
The recover() override queries confidentialBalanceOf for the encrypted
handle and passes it directly as the transfer amount — no Zama relayer
needed for recovery.

- Add encryptedHandle option to RecoverOptions for manual override
- Add queryConfidentialBalance() for on-chain eth_call
- Override setGasLimit() with 800k default (validated ~530k on Hoodi)
- Guard against TSS recovery (not yet supported)
- Add unit tests for recover, queryConfidentialBalance, setGasLimit

TICKET: CHALO-1115
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant