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

Add "long" payment reference calculator function #1448

Open
MantisClone opened this issue Sep 6, 2024 · 0 comments
Open

Add "long" payment reference calculator function #1448

MantisClone opened this issue Sep 6, 2024 · 0 comments

Comments

@MantisClone
Copy link
Member

MantisClone commented Sep 6, 2024

Problem

The RN SDK provides a PaymentReferenceCalculator calculates the "short" payment reference but not the "long" payment reference.

Proposed Solution

Add a function to the PaymentReferenceCalculator that calculates the "long" payment reference.

Details

  • The payment reference input to transferFromWithReferenceAndFee() is 8-byte "short" payment reference (see attached image)
  • The payment reference output from the TransferWithReferenceAndFee event is the "long" keccak256 hash of the 8-byte short payment reference (see attached image)
  • The payments-subgraph indexes the "long" keccak256 hash of the 8-byte short payment reference
  • The RN SDK calculates the "long" hash when querying the payments subgraph <-- Use this to create the new function in PaymentReferenceCalculator.

Additional Detail

  • If someone gets the "long" payment reference from the payments-subgraph, there's no way to figure out the corresponding "short" payment reference. I think this is okay 🙆‍♀️

Reference

Screenshots

Image
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant