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

Split dip 8 to funds pull pre approval and charge + auth/capture #2

Draft
wants to merge 57 commits into
base: master
Choose a base branch
from

Conversation

danprinz
Copy link

No description provided.

kphfb and others added 13 commits March 15, 2021 13:57
Disclaimer regarding the discovery phase
Extended scope for fund pull pre-approval
Revoke an authorization in more details
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Copy link

@davidiw davidiw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming along well.

I'm going to leave some crazy ideas here for now and we can setup some time to chat:

  • Move as much to the interaction between Web services as possible to speed up UX and to make it less Diem off-chain dependent
  • Don't reinvent off-chain protocol, create a new payment command that leverages all the existing fields but results in an auth instead of a payment -- it might be kyc, but we can effectively shoehorn in kyb -- we will work (together) on a better off-chain and make that ideal -- but I don't want to add too much (more) complexity now
  • Use off-chain to trigger capture
  • Define an on-chain extension for registering a URL for a small logo to represent a VASP on a merchant website -- an parallel resource to the DiemId resource defined in Dip-10 -- but completely VASP managed -- this would also be where the VASP registers if login -- which I didn't actually see mentioned here

dips/dip-8.md Outdated
Version 0 of the Off-Chain Protocol is described in [DIP 1](https://dip.diem.com/dip-1/). Version 1 as described here is an extension of the Off-Chain Protocol and adds features to support more advanced functionality - particularly targeted to support merchant use-cases. This is inclusive of pull payments, recurring payments, and auth/capture flows.
Versions 1/2 of the Off-Chain Protocol are described in [DIP 1](https://dip.diem.com/dip-1/).

Version 3 as described here is an extension of the Off-Chain Protocol and adds features to support more advanced functionality - particularly targeted to support merchant use-cases.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think we need a new version here, this should be a different command, otherwise we have to consider version negotiation, which I'm not convinced is worth it at this point in time.

dips/dip-8.md Outdated
This DIP aimed to support a scenario of setting a Diem wallet as a long term payment method in an app or an eCommerce website.

The high level flow is:
1. The user asks to add their wallet to the app as a payment method
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems ... a little too ambiguous to me

  1. User enters checkout flow
  2. User clicks "Pay with Diem"
  3. The user is presented with a list of registered Diem VASPs that support Merchant payments
  4. The user selects their VASP
  5. The merchant site opens an iframe sending forwarding the appropriate information for a FPPA request
  6. The user logins and confirms the transaction
  7. The VASP sends an FPPA response to the Merchant

Behind the scenes

  1. The FPPA request sent entirely in the iframe URL
  2. Upon login, the VASP initiates an off-chain kyc exchange with the merchant
  3. Upon the conclusion of the off-chain, the VASP and Merchant have agreed upon fppa_id for future pull payments

dips/dip-8.md Outdated
Comment on lines 71 to 72
| checkout_data_type | str | Y | The fixed string `FUNDS_PULL_PRE_APPROVAL` |
| action | str | Y | The fixed string `FUNDS_PULL_PRE_APPROVAL` |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we have this twice ... why not make this part of the URL syntax?

dips/dip-8.md Outdated

## Funds pull pre approval request fields

The following fields should be used to define a funds pull pre approval request. These fields should be encoded into a series of URL parameters appended to the query string. In case of QR code, the image should include the full link with all parameters.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so part of me wonders... we're going to have to go off-chain at some point anyway, so should we just pass along a payment_id and a vasp_address

dips/dip-8.md Outdated

| Field | Type | Required? | Description |
|------------------------|---------|------------|------------------------------------------------|
| vasp_address | str | Y | Address of account from which billing will happen. The address is encoded using bech32 and should uniquly identify the merchant. For Diem addresses format, refer to the "account identifiers" section in [DIP-5](https://dip.diem.com/dip-5/#account-identifiers). |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what vasp_address means... maybe this should say psp_account and the right side will actually be one of many possibilities: DiemId, dip-5, or even other identifiers... otherwise we continue to make bespoke diem protocols, yay.

dips/dip-8.md Outdated
All requests between VASPs are structured as [`CommandRequestObject`s](https://dip.diem.com/dip-1/#commandrequestobject) and all responses are structured as [`CommandResponseObject`s](https://dip.diem.com/dip-1/#commandresponseobject). For a fund pre-approval command, the resulting request takes a form of the following:
All requests between VASPs are structured as [`CommandRequestObject`s](https://dip.diem.com/dip-1/#commandrequestobject) and all responses are structured as [`CommandResponseObject`s](https://dip.diem.com/dip-1/#commandresponseobject).

For a funds pull pre-approval command, the resulting request takes a form of the following:

```
{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we already sent most of this via a auth framework, why are we sending it again via off-chain protocol? I think this function should purely be about doing a pre auth kyc... so this should largely be a copypasta of dip-1 -- but with the new states rauth / sauth, right?

dips/dip-158.md Outdated Show resolved Hide resolved
dips/dip-158.md Outdated Show resolved Hide resolved
dips/dip-158.md Outdated Show resolved Hide resolved
dips/dip-158.md Outdated Show resolved Hide resolved
dips/dip-158.md Outdated Show resolved Hide resolved
dips/dip-158.md Outdated Show resolved Hide resolved
dips/dip-158.md Outdated Show resolved Hide resolved
dips/dip-158.md Outdated Show resolved Hide resolved
dips/dip-158.md Outdated Show resolved Hide resolved
dips/dip-158.md Outdated Show resolved Hide resolved
YinonFirstDAG and others added 13 commits April 18, 2021 12:36
Disclaimer regarding the discovery phase
Extended scope for fund pull pre-approval
Revoke an authorization in more details
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
Co-authored-by: kphfb <kph@fb.com>
danprinz and others added 25 commits April 18, 2021 14:32
Co-authored-by: dahliamalkhi <dahliamalkhi@outlook.com>
Co-authored-by: dahliamalkhi <dahliamalkhi@outlook.com>
Co-authored-by: dahliamalkhi <dahliamalkhi@outlook.com>
Co-authored-by: dahliamalkhi <dahliamalkhi@outlook.com>
Co-authored-by: dahliamalkhi <dahliamalkhi@outlook.com>
Co-authored-by: David Wolinsky <isaac.wolinsky@gmail.com>
Co-authored-by: David Wolinsky <isaac.wolinsky@gmail.com>
Notes:
Agreed that we will create new structures for P2M purposes rather than impose changes on existing structures from 0 < DIP < 2  (did not want to use the actual DIP name :)).
For example, we will NOT extend or change the PaymentActorObject. Instead, we will create a new object suitable for P2M needs (e.g. BusinessActorObject).
Agreed that business_data (i.e. merchant basic details) should be part of the InfoCommand response
Agreed that payer_data (i.e. payer information) should be part of the InitCommand(s) request
Agreed that, for the time being, there is no support for an additional step to ask for more data.
The receiving VASP can either accept or reject the payment based on the information provided.
We mentioned that the receiving VASP should be able to state "extra" information that is required on top of the payer_data (e.g. DOB might be required for buying alcohol) as part of the InfoCommand response.
This will be achieved by an additional optional element (type will be JSON)
A similar optional element will be added to the InitCommand(s) request. This element is to be used by the sending VASP to send the additional information requested (e.g. DOB)
Agreed (with a heavy heart...) to stop using the functionality names and stick with the command types
Agreed to use two different init command types (for each payment type) to replace the single InitCommand
We will change the name of the ReadyCommand to be ReadyNotification
Add dual attestation specification for transactions over the limit
Main changes:
* Removed DIP-8 fro the pull request
* Change InfoCommand name
* Added image_url to business_data
* Spelling and grammar issues
* Removed usage of statuses
* Naming consistency
* Optional redirect URL for QR flow (POS scenario)
Added diagram images
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.

5 participants