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

Implement push notifications for signing requests #190

Closed
Uxio0 opened this issue Dec 1, 2020 · 0 comments · Fixed by #193
Closed

Implement push notifications for signing requests #190

Uxio0 opened this issue Dec 1, 2020 · 0 comments · Fixed by #193

Comments

@Uxio0
Copy link
Member

Uxio0 commented Dec 1, 2020

Push notifications registration changes

  • Uuid field will be required (need to keep it optional for a while to support existing clients).
  • Timestamp field: within the last 5 minutes from the current UTC time in epoch seconds format.
  • Signatures field: array of signatures of the registration request by the owner keys imported in the client. Associate those signing addresses with the cloud messaging token. Hex string: 0x + hex(r) + hex(s) + hex(v + 27)

Add new type of notification CONFIRMATION_REQUEST

Sent on receiving new transaction for a Safe to those cloudMessaging tokens that have associated owner keys and those owner keys are owners of the safes that will have this transaction, and those keys did not sign that transaction.

Signature calculation

To calculate the signature, the following fields must be used:

  • prefix: constant, it will be gnosis-safe
  • timestamp:
  • uuid: uuid of the device
  • cloudMessagingToken
  • safes: concat list of sorted checksummed addresses

So the hash must be calculated:
keccak256($prefix + timestamp + uuid + cloudMessagingToken + sorted(safes)

For example:

  • prefix = “gnosis-safe”
  • timestamp = 1605186645155
  • uuid = “33971c4e-fb98-4e18-a08d-13c881ae292a”
  • cloudMessagingToken = “dSh5Se1XgEiTiY-AXQAX21”
  • safes = [“0xbDEbdd6CEE25b2F931D2FE265D70E1A533b02453”, “0xa2AC1760DAf52986421b1552bDCa04707e78950E”]

keccak256("gnosis-safe160518664515533971c4e-fb98-4e18-a08d-13c881ae292adSh5Se1XgEiTiY-AXQAX210xa2AC1760DAf52986421b1552bDCa04707e78950E0xbDEbdd6CEE25b2F931D2FE265D70E1A533b02453)

More details in the spec document https://docs.google.com/document/d/1RqIfZkqdS_TZ4IQVjeWUhNI1ZguD3NfpohSSRLVxB5Q/edit#

@Uxio0 Uxio0 closed this as completed in #193 Dec 4, 2020
Uxio0 added a commit that referenced this issue Dec 4, 2020
- Refactor create/update Firebase device endpoint
- Protect endpoint with signatures/timestamp
- Create new model on database `FirebaseDeviceOwner`
- Add new `NotificationType`: `CONFIRMATION_REQUEST`
- Create new task to send notifications to owners
- Add tests
- Closes #190
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 a pull request may close this issue.

1 participant