Summary
Deprecate and reject the events field in scanShieldedTRC20NotesByIvk / scanShieldedTRC20NotesByOvk API requests. Remove server-side log-type filtering; all log types are always inspected during a scan.
Problem
Motivation
The events field in IvkDecryptTRC20Parameters and OvkDecryptTRC20Parameters allows callers to pass arbitrary topic strings that are hashed and matched server-side to filter shielded TRC20 event classes (Mint / Transfer / Burn). This is an unnecessary attack surface and a source of complexity.
Current State
- The
events field is accepted by gRPC and HTTP endpoints
- Server-side code hashes user-supplied topic strings via
Hash.sha3() and matches them against known log topics
- Callers can selectively scan only specific log types
Limitations or Risks
- User-controlled strings are hashed server-side, expanding the API attack surface unnecessarily
- Selective scanning can be used for information leakage through side-channel timing
- The filtering logic adds complexity to
Wallet.getShieldedTRC20LogType() with nested conditionals
- Clients should filter results client-side rather than relying on server-side filtering
Proposed Solution
Proposed Design
- Mark the
events field as [deprecated = true] in api.proto
- Reject requests containing the deprecated field at runtime: gRPC returns
INVALID_ARGUMENT, HTTP returns 400
- Remove the
topicList / topicsList parameter from all internal method signatures (Wallet, RpcApiService, HTTP servlets)
- Simplify
getShieldedTRC20LogType() to always match against all known log topics
Key Changes
- Protocol:
api.proto — deprecate events field in IvkDecryptTRC20Parameters and OvkDecryptTRC20Parameters
- API:
RpcApiService — add INVALID_ARGUMENT rejection for Full, Solidity, and PBFT stubs
- API:
ScanShieldedTRC20NotesByIvkServlet, ScanShieldedTRC20NotesByOvkServlet — add HTTP 400 rejection
- Module:
Wallet — remove topicList parameter, simplify getShieldedTRC20LogType()
Impact
- Security: Reduces API attack surface by removing server-side processing of user-controlled strings
- Stability: Simplifies scan logic, fewer code paths to maintain
- Developer Experience: Cleaner API contract — callers no longer need to understand topic filtering
Compatibility
- Breaking Change: Yes
- Default Behavior Change: All log types are now always scanned; clients that relied on the
events field to limit scope will receive results for all log types
- Migration Required: Clients must remove the
events field from requests; otherwise requests will be rejected
Additional Notes
- Do you have ideas regarding implementation? Yes
- Are you willing to implement this feature? Yes
Summary
Deprecate and reject the
eventsfield inscanShieldedTRC20NotesByIvk/scanShieldedTRC20NotesByOvkAPI requests. Remove server-side log-type filtering; all log types are always inspected during a scan.Problem
Motivation
The
eventsfield inIvkDecryptTRC20ParametersandOvkDecryptTRC20Parametersallows callers to pass arbitrary topic strings that are hashed and matched server-side to filter shielded TRC20 event classes (Mint / Transfer / Burn). This is an unnecessary attack surface and a source of complexity.Current State
eventsfield is accepted by gRPC and HTTP endpointsHash.sha3()and matches them against known log topicsLimitations or Risks
Wallet.getShieldedTRC20LogType()with nested conditionalsProposed Solution
Proposed Design
eventsfield as[deprecated = true]inapi.protoINVALID_ARGUMENT, HTTP returns 400topicList/topicsListparameter from all internal method signatures (Wallet,RpcApiService, HTTP servlets)getShieldedTRC20LogType()to always match against all known log topicsKey Changes
api.proto— deprecateeventsfield inIvkDecryptTRC20ParametersandOvkDecryptTRC20ParametersRpcApiService— addINVALID_ARGUMENTrejection for Full, Solidity, and PBFT stubsScanShieldedTRC20NotesByIvkServlet,ScanShieldedTRC20NotesByOvkServlet— add HTTP 400 rejectionWallet— removetopicListparameter, simplifygetShieldedTRC20LogType()Impact
Compatibility
eventsfield to limit scope will receive results for all log typeseventsfield from requests; otherwise requests will be rejectedAdditional Notes