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

Integrate Handoff Protocol #140

Closed
wants to merge 19 commits into from
Closed

Conversation

koczadly
Copy link

@koczadly koczadly commented Jun 21, 2021

Prototype integration of the Handoff Payment protocol.

See relevant forum thread for more info (slightly outdated): https://forum.nano.org/t/unique-payment-id-via-payment-protocol/1253

Changelog

  • Support for entry via nanohandoff URI
  • Add additional decoded handoff parameter to nano URI (Address)
  • Add new Payments table to local database which stores information about outgoing transactions/blocks.
    • Stores a reference or message (Note: this is currently not shown to the user anywhere)
    • Remembers which protocol was used to make the payment (so that Handoff/Manta payments cannot be 'repeated' through left-swipe)
    • Allows multi-use handoff payments to be repeated by storing the payment request info
  • Show a warning when repeating a transaction (left-swipe) which doesn't exist in the local payments database (ie. made on another wallet or device)
  • Refactored how state info is entered and updated in send sheet (now a single method)
  • Various other small code refactorings
  • Add the ability to make the destination address read-only in the send sheet (used with Handoff only)
  • Add primitive unit tests for parsing payment request
  • Add ability to show a custom message upon successful payment
  • Additions to localization (only English):
    • handoffInvalid - Payment request cannot be parsed or is incompatible with the wallet
    • handoffPaymentFailed - Payment couldn't be made (possibly followed by details)
    • handoffPaymentAlreadyComplete - Payment has already been made
    • handoffExpired - Payment has expired
    • usingHandoff - Notice on the confirmation sheet showing the handoff protocol will be used
    • paymentCannotReplay - When a payment cannot be repeated (left-swiped)
    • sendDestinationWarning - Warning when replaying (left-swipe) unrecognized payments

Implementation notes

  • Wallet-side work generation for handoffs is not supported (work_generate RPC is not publicly exposed)
  • Only https channel is currently supported

Other notes

  • I couldn't get this to build without enforcing a specific commit hash for the intl_translation dependency and making a small change to the build.gradle. The patches to fix these issues have not been included in this PR (I assume it's a problem with my local env)
  • Should be relatively easy to add new payment channels (the medium which the wallet uses to communicate with the payment processor) to the system in the future.

…tions, and add warnings to previous or uncertain transaction types. Also implements payment reference tracking, though this isn't used as of now. Changes to various handoff-related localization messages have also been made.
@koczadly
Copy link
Author

koczadly commented Oct 9, 2021

Currently in the process of revising the protocol and making adjustments, will submit a new PR at a later date when everything's been updated.

@koczadly koczadly closed this Oct 9, 2021
@bbedward bbedward mentioned this pull request Dec 14, 2021
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