teloscan icon indicating copy to clipboard operation
teloscan copied to clipboard

Implement Input Data Message (IDM) Display

Open pmjanus opened this issue 1 year ago • 0 comments

Implement Input Data Message (IDM) Display for Ethereum Transactions

Description

We need to implement a feature to display and handle Input Data Messages (IDM) for transactions. This feature will improve user experience by providing clear indication and easy access to human-readable messages included in transaction data.

Important: When a transaction is a transfer, and input data is not 0x0 all input data should be treated as an Input Data Message in the Transaction Action field and UTF-8 decoded.

Current Behavior

Currently, our system does not distinguish or specially handle transactions that include human-readable messages in their input data.

Desired Behavior

  1. Treat all input data as potential Input Data Messages.
  2. Attempt to decode all input data using UTF-8 encoding.
  3. Display the decoded input data in the Transaction Action field.
  4. Visually indicate the presence of these messages in the transaction list or details view.
  5. Provide a way for users to easily view the full decoded message content.

Implementation Details

Detection and Decoding

  • Attempt to decode all input data using UTF-8 encoding.
  • If decoding fails, display the original hexadecimal input data.

Display

  • Show the decoded input data (or original hex if decoding fails) in the Transaction Action field.
  • Add an indicator (e.g., an asterisk or icon) next to transactions with input data.
  • Implement a hover tooltip with the message: "Includes data in Input Data."
  • Create an expandable section or modal to display the full decoded message when requested.

Additional Considerations

  • Handle large input data efficiently to prevent display and performance issues.
  • Implement proper escaping and sanitization of decoded messages to prevent XSS vulnerabilities.
  • Consider adding support for other common encodings if UTF-8 decoding fails.

Acceptance Criteria

  1. All transactions with input data are treated as having an Input Data Message.
  2. The Transaction Action field displays the UTF-8 decoded input data for all transactions. Example:
  3. If UTF-8 decoding fails, the original hexadecimal input data is displayed.

Resources

  • Example transaction with UTF-8 data: https://etherscan.io/tx/0x935eca5f986e4be6ae21e627b89d966e4c1750d628a0f2ef672b1a4edbfb8b7c
  • Example transaction with "DC-L5:" prefix: https://etherscan.io/tx/0xf5e0ea35a94b1a8a1741e232dc74bed467f100a459b3204beda275d460ab11e9

Related Issues

  • #806

pmjanus avatar Aug 06 '24 14:08 pmjanus