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

SEP24 - A simpler SEP6 #407

Merged
merged 11 commits into from
Oct 3, 2019
Merged

SEP24 - A simpler SEP6 #407

merged 11 commits into from
Oct 3, 2019

Conversation

msfeldstein
Copy link
Contributor

@msfeldstein msfeldstein commented Sep 18, 2019

SEP6 has gone through many iterations, and retains many artifacts of previous incarnations which can be confusing to implementors and result in out-of-spec implementations. I've created a fresh SEP that is still compatible with SEP-6 but leaves all the non-interactive stuff behind.

Changes from SEP6 can be seen at this commit (bc1433a)

Changes made to the SEP6 doc:

  1. Removed all the non-interactive responses
  2. Require SEP10 on everything but info. It's definitely required on /transaction endpoints so i don’t know why it would be beneficial to make it optional on /deposit/withdraw since it should all happen behind the scenes, invisible to the user.
  3. Remove the account parameter on /transactions. It's not needed since auth is required and you can get the account from there.
  4. Added suggestion for using SEP9 values as query parameters to the interactive webapp in order to pre-fill fields. This is a replacement to using SEP12, but still getting the benefits without needing a lot of wallet-anchor communication.
  5. 
Removed type as a parameter for /deposit and /withdraw. Move this into the interactive flow as well.
  6. Removed fields, and types from the deposit/withdraw responses. This is used for SEP12 and we don't want to suggest that anymore.
  7. Moved transaction endpoint fields into separate deposit and withdraw tables
  8. Removed external_extra since this should all live in a human readable more_info_url

There is some additional cleanup i want to do, but this is the cleanest diff from sep6 atm.

Future cleanup: Re-ordering sections so they appear in the order which a UX flow would hit them, add some UX mocks to show what the status should look like when, make missing JWTs an error case, and possibly letting us return 200 instead of 403 to return the interactive_customer_info_needed url (in addition to 403 to not break existing anchors)

@tomquisel
Copy link
Contributor

What's the compatibility goal with existing "modern" SEP-6 implementations like the SEP-6 demo client or AnchorUSD?

@msfeldstein
Copy link
Contributor Author

This should be fully compatible. I've made no breaking changes, just limited the feature set to the interactive flow

Copy link
Contributor

@tomquisel tomquisel left a comment

Choose a reason for hiding this comment

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

Looks good! I made a few minor comments on the commit diff, but they aren't critical to address.

Copy link
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

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

Some questions that don't need to block the PR at all.

ecosystem/sep-0024.md Outdated Show resolved Hide resolved
ecosystem/sep-0024.md Show resolved Hide resolved
ecosystem/sep-0024.md Show resolved Hide resolved

## Simple Summary

This SEP defines the standard way for anchors and wallets to interact on behalf of users. This improves user experience by allowing wallets and other clients to interact with anchors directly without the user needing to leave the wallet to go to the anchor's site. It is based on, and backwards compatible with, [SEP-0006](sep-0006.md), but only supports the interactive flow, and cleans up or removes confusing artifacts.
Copy link
Member

Choose a reason for hiding this comment

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

...allowing wallets and other clients to interact with anchors directly without the user needing to leave the wallet to go to the anchor's site...

Because we're standardizing on the interactive flow the user will need to leave the wallet to go to a web page. Ideally that leaving the wallet will occur in an OS embedded browser in the app where the user can see the URL and has confidence about the website they are using, and it isn't an embedded web view. This statement feels a little misleading because the user will be using the anchors interactive flow, which I assume is a website.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems like something that's more of a suggestion to wallet implementors. Interactive websites should have branding that makes it clear who it is, but if a wallet sends you to a malicious webpage it means your wallet is compromised and all bets are off anyway

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 is worthwhile to do some security thinking (if not a full audit) on whether there's a way for a malicious entity to impersonate an anchor. Given the two way binding between asset and DNS entry it seems difficult, but definitely something to keep in mind

Copy link
Member

Choose a reason for hiding this comment

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

if a wallet sends you to a malicious webpage it means your wallet is compromised and all bets are off anyway

This isn't always true. If a user is trying out a wallet for the first time and planning to deposit a small amount from their personal bank account that holds their life savings, there's little risk if the they lose that small amount of money to the wallet, but a huge risk if a maliciously crafted webview usage captures a users bank account credentials.

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'm not sure what the attack vector you're referring to is, that still sounds like a malicious wallet stealing peoples bank info, and they wouldn't comply with our requirement to open in the system browser anyway

Copy link
Member

Choose a reason for hiding this comment

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

Agreed, but if we make it part of our recommendations that apps use a system browser it sets expectations and recommendations that hopefully app developers will follow that will increase the trust that others can have in using their apps. I think this is similar to how we recommend HTTPS in this SEP.

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 is, however, a good discussion of whether training people to enter sensitive info into embedded third party webviews inside of another third party app is something that's dangerous in general, even if this particular use case isn't dangerous. I'm not thrilled about the lines blurred between wallet and anchor in this flow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah let me marinate on this a bit. I don't want to block landing this in Draft status on this, but would like to give it some thought before we move it to Active. @tomquisel any thoughts here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @leighmcculloch about it being a best practice to show the user the URL. That said, realistically, I'm not sure it affects the security profile much. In most cases, the user has no idea who the anchor is at the start, or what domain to expect the anchor to be on, so I don't know how much that URL helps.

ecosystem/sep-0024.md Outdated Show resolved Hide resolved
ecosystem/sep-0024.md Show resolved Hide resolved
ecosystem/sep-0024.md Outdated Show resolved Hide resolved
ecosystem/sep-0024.md Show resolved Hide resolved
@antb123
Copy link
Contributor

antb123 commented Sep 21, 2019 via email

@msfeldstein
Copy link
Contributor Author

That's the goal. If you find any incompatibilities let me know

Copy link
Member

@accordeiro accordeiro left a comment

Choose a reason for hiding this comment

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

LGTM! I've left some comments, but none should block the PR from being merged.

@msfeldstein what are your thoughts about how we'll evolve this SEP and SEP6 moving forward? Should we always make sure we send a PR with updates to both?

ecosystem/sep-0024.md Outdated Show resolved Hide resolved
ecosystem/sep-0024.md Show resolved Hide resolved
ecosystem/sep-0024.md Show resolved Hide resolved
@msfeldstein
Copy link
Contributor Author

what are your thoughts about how we'll evolve this SEP and SEP6 moving forward? Should we always make sure we send a PR with updates to both?

I'd rather deprecate SEP6 and create another sep for non-interactive if its useful for the ecosystem. Having the messy documentation of sep6 which is really 2 different approaches mixed together is no good

msfeldstein and others added 7 commits September 24, 2019 10:10
Co-Authored-By: Alex Cordeiro <accordeiro@users.noreply.github.com>
Co-Authored-By: Leigh McCulloch <leigh@stellar.org>
Co-Authored-By: Leigh McCulloch <leigh@stellar.org>
@msfeldstein msfeldstein merged commit f3945c5 into master Oct 3, 2019
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.

None yet

5 participants