Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use message id as a identifier for duplication check mechanism #130

Closed
skibitsky opened this issue Oct 6, 2023 · 0 comments · Fixed by #184
Closed

Use message id as a identifier for duplication check mechanism #130

skibitsky opened this issue Oct 6, 2023 · 0 comments · Fixed by #184
Assignees
Labels
enhancement New feature or request

Comments

@skibitsky
Copy link
Member

Currently, the client JSON RPC duplication mechanism uses the client JSON RPC ID as a unique identifier to detect duplicated client JSON RPC requests.

Since this approach doesn't guarantee the uniqueness of IDs and there's a chance of conflicts a new approach with higher entropy is introduced.

The new id is a sha256 function of the decrypted payload of the client request:
message_id = sha256(decrypted_payload)

Testing:

  • Make sure that backward compatibility is not broken
  • Cross-platform testing (js, swift, kotlin, flutter)

Here is where the id is currently generated in WalletConnectSharp:

You could pass a new calculated id to the JsonRpcRequest constructor in the TypeMessageHandler.SendRequest function, which would make the change backwards compatible.


Original issue in WalletConnectUnity: #103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant