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

Sender Initiated Reference ID Exchange #186

Merged
merged 5 commits into from
Jun 25, 2021
Merged

Sender Initiated Reference ID Exchange #186

merged 5 commits into from
Jun 25, 2021

Conversation

sunmilee
Copy link
Contributor

Reference ID off-chain exchange DIP. Used by DIP-10 Diem ID protocol.

#183

@sunmilee sunmilee mentioned this pull request Jun 15, 2021
@sunmilee sunmilee requested a review from davidiw June 15, 2021 10:04
dips/dip-183.md Outdated Show resolved Hide resolved
dips/dip-183.md Outdated Show resolved Hide resolved
dips/dip-183.md Outdated Show resolved Hide resolved
dips/dip-183.md Outdated Show resolved Hide resolved
dips/dip-183.md Outdated Show resolved Hide resolved
dips/dip-183.md Outdated Show resolved Hide resolved
dips/dip-183.md Show resolved Hide resolved
dips/dip-183.md Outdated Show resolved Hide resolved
@sunmilee sunmilee requested a review from davidiw June 22, 2021 10:08
dips/dip-183.md Outdated

This DIP describes a protocol standard for sender initialized pre-flight exchange using reference ID to form payment transactions.

Reference ID is used as a unique identifier for a payment transaction between two parties across two VASPs without revealing any information about those parties on-chain.
Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC, each VASP will need to maintain every unique (reference id, sending VASP, receiving VASP) identifier to ensure avoiding duplicate reference ids?

Can VASP A initiate a reference ID R to VASP B
and VASP B also legally initiate a reference ID R to VASP A or is it unique per pair?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unique per pair, so between VASP A and B, if a reference ID R was used in a previous transaction, regardless of which one initiated it, R cannot be reused for any future transactions between A and B

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the clarification. I think it would be good to add something like your statement into the DIP to make this clear.

We should consider from an implementor perspective how feasible this is to implement. I guess it is expected that the implementor would need to maintain an index of (canonical(VASP1, VASP2), reference ID) and rebuild it from the event history if they lost the index.

This might be simpler if, say, there was just a monotonically increasing reference ID number so one could just look at the last number between canonical(VASP1, VASP, last reference ID number) event on-chain rather than keeping an index?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it depends on how the VASP decides to implement it. They can always enforce uniqueness across all reference IDs instead of pair, which is what I do in my miniwallet diem ID example.

Comment on lines +22 to +23
Reference IDs are unique between a pair of VASPs, `VASP A` and `VASP B`, so if a reference ID `r` was used in a previous transaction between the two VASPs, regardless of which one initiated it, `r` cannot be reused for any future transactions between `VASP A` and `VASP B`.
However, the same `r` value can be used between a different VASP pair, `VASP A` and `VASP C`. VASPs may choose to keep reference IDs globally unique across all VASPs as well.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also added more details on ref ID uniqueness @aching

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I think the first sentence was good enough, but I'd rather over specify than have confusion :P

Copy link
Contributor

@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.

forgot to submit this earlier.

dips/dip-183.md Outdated Show resolved Hide resolved
dips/dip-183.md Outdated Show resolved Hide resolved
dips/dip-183.md Outdated Show resolved Hide resolved
dips/dip-183.md Outdated Show resolved Hide resolved
dips/dip-183.md Outdated Show resolved Hide resolved
dips/dip-183.md Outdated Show resolved Hide resolved
@sunmilee sunmilee requested review from aching and davidiw June 25, 2021 23:10
Comment on lines +22 to +23
Reference IDs are unique between a pair of VASPs, `VASP A` and `VASP B`, so if a reference ID `r` was used in a previous transaction between the two VASPs, regardless of which one initiated it, `r` cannot be reused for any future transactions between `VASP A` and `VASP B`.
However, the same `r` value can be used between a different VASP pair, `VASP A` and `VASP C`. VASPs may choose to keep reference IDs globally unique across all VASPs as well.
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I think the first sentence was good enough, but I'd rather over specify than have confusion :P

@davidiw davidiw merged commit fb6e9d2 into diem:main Jun 25, 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.

3 participants