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

Update SEP-6 flow to delegate getting KYC fields to SEP-12 #1432

Merged
merged 8 commits into from
Feb 21, 2024

Conversation

Ifropc
Copy link
Contributor

@Ifropc Ifropc commented Jan 26, 2024

Background

Current SEP-6 flow for working with KYC is quite complex from the anchor standpoint: it requires to pass the same set of information (required KYC fields) via both SEP-6 and SEP-12. This proposal aims to simplify the flow for both anchor and wallet. This proposal logically separates SEP-6 and SEP-12, and all work with KYC is done via SEP-12.

Proposed flow

The process of providing information to the anchor looks as follows:

  1. GET /transaction and verify transaction status is pending_customer_info_update
  2. Get required fields via [SEP-12] GET /customer request. Note, that you must pass transaction_id as part of the
    request.
  3. Collect user input for the required fields and use [SEP-12] PUT /customer endpoint to transfer the data
  4. Repeat steps 2-3 until customer's response status becomes ACCEPTED
  5. GET /transaction should transition to the next status (pending_user_transfer_start)

Proposed change

This proposal includes multiple changes in order to simplify the flow.

SEP-6:

  1. Deprecate response code 403 (Forbidden) from the anchor on missing customer information. Instead, anchor should return 200 and create the transaction in status pending_customer_info_update
  2. Remove required_customer_info_message and required_customer_info_updates. This field have not being adopted yet, so it's safe to remove them. Instead, transaction in status pending_user_transfer_start should use existing message field to indicate that additional input is required, and use [SEP-12] PUT /customer endpoint (with transaction id)

SEP-12:
Add transaction_id field to GET /customer and PUT /customer, allowing to fetch/update fields required in the scope of specific transaction

@Ifropc Ifropc requested review from philipliu and JakeUrban January 26, 2024 01:32
`fee_fixed` | float | (optional) If there is a fee for withdraw. In units of the withdrawn asset. `fee_percent` | float
| (optional) If there is a percent fee for withdraw. `extra_info` | object | (optional) Any additional data needed as an
input for this withdraw, example: Bank Name.
asynchonously.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changes below fixes formatting

ecosystem/sep-0012.md Outdated Show resolved Hide resolved
ecosystem/sep-0006.md Show resolved Hide resolved
ecosystem/sep-0012.md Show resolved Hide resolved
ecosystem/sep-0006.md Show resolved Hide resolved
ecosystem/sep-0006.md Outdated Show resolved Hide resolved
@@ -102,6 +102,7 @@ Name | Type | Description
`memo` | string | (optional) the client-generated [memo](https://developers.stellar.org/docs/glossary/transactions/#memo) that uniquely identifies the customer. If a memo is present in the decoded SEP-10 JWT's `sub` value, it must match this parameter value. If a muxed account is used as the JWT's `sub` value, memos sent in requests must match the 64-bit integer subaccount ID of the muxed account. See the [Shared Accounts](#shared-omnibus-or-pooled-accounts) section for more information.
`memo_type` | string | (**deprecated**, optional) type of `memo`. One of `text`, `id` or `hash`. Deprecated because memos should always be of type `id`, although anchors should continue to support this parameter for outdated clients. If `hash`, `memo` should be base64-encoded. If a memo is present in the decoded SEP-10 JWT's `sub` value, this parameter can be ignored. See the [Shared Accounts](#shared-omnibus-or-pooled-accounts) section for more information.
`type` | string | (optional) the type of action the customer is being KYCd for. See the [Type Specification](#type-specification) below.
`transaction_id` | `string` | (optional) The transaction id with which the customer's info is associated. When information from the customer depends on the transaction (e.g., more information is required for larger amounts) |
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Should we specify what type of transaction this refers to? i.e. it refers to the "action" mentioned in the type specification section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's up to the anchor implementation. However, in Platform implementation we will require type to be specified, that matches appropriate SEP (so client application should pass both transaction_id=abc and type=sep24 for example) so we know which table to lookup, and to avoid ambiguity when different protocols have transactions with the same id

JakeUrban
JakeUrban previously approved these changes Feb 9, 2024
JakeUrban
JakeUrban previously approved these changes Feb 21, 2024
philipliu
philipliu previously approved these changes Feb 21, 2024
@Ifropc Ifropc dismissed stale reviews from philipliu and JakeUrban via 0d643f1 February 21, 2024 19:08
@Ifropc Ifropc requested a review from philipliu February 21, 2024 19:08
@Ifropc Ifropc merged commit 1987ea7 into master Feb 21, 2024
2 checks passed
@Ifropc Ifropc deleted the PARTNER-214-SEP-6 branch February 21, 2024 19:09
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.

3 participants