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

UCAN-based authorized uploads with web3.storage #261

Open
dchoi27 opened this issue Aug 1, 2021 · 5 comments
Open

UCAN-based authorized uploads with web3.storage #261

dchoi27 opened this issue Aug 1, 2021 · 5 comments
Labels
Epic kind/enhancement A net-new feature or improvement to an existing feature need/approach P1 High: Likely tackled by core team if no one steps up topic/pot Issues handled by PT.

Comments

@dchoi27
Copy link
Contributor

dchoi27 commented Aug 1, 2021

UPDATE: We'll be implementing UCAN-based authorization after implementing it in NFT.Storage (issue here: nftstorage/nft.storage#851)


We want tons of end user-facing apps to build on top of web3.storage, and for it to be easy for developers to build these apps following best-practice patterns that we recommend. At the moment, the primary approach is for users to store data with web3.storage via trusted centralized servers that the app developer manages, with these servers containing and managing keys that are used to store all user data.

image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png

As we get more user feedback and understand what developers are building on top of web3.storage, we should make it possible for alternative, more decentralized access patterns with web3.storage. Some potential examples include:

  • Mechanism for assigning and managing web3.storage access keys for end users
  • Wallet-based sign-in and management of end user storage on web3.storage
  • Writeable gateway (that may or may not require authentication)
@dchoi27 dchoi27 added feature kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up and removed feature labels Aug 1, 2021
@dchoi27 dchoi27 added P1 High: Likely tackled by core team if no one steps up Epic and removed P2 Medium: Good to have, but can wait until someone steps up labels Aug 23, 2021
@dchoi27 dchoi27 changed the title Direct end user interaction with web3.storage Direct end-user interaction with web3.storage Aug 23, 2021
@dchoi27
Copy link
Contributor Author

dchoi27 commented Aug 23, 2021

Requirement: Web3.Storage authenticates a user of an application

Options (non-mutually exclusive):

  • Use wallet auth
  • Use magic.link private key (developers would share their private key, and users would need to sign in to the application using magic.link)
  • Developers provide an endpoint where folks can create a scoped user token

Some additional requirements on making this compatible with efforts around token scoping #314

@mikeal
Copy link

mikeal commented Aug 23, 2021

I think the base requirements here, which are shared with #314 are:

  • Allow end-users to be authenticated against dotStorage
    • Tag incoming data with user information that is indexed and can be used in API’s for listing user CID’s
    • Enable backend-less development with dotStorage
      • Wallet auth gets this for users who have crypto wallets
      • Accepting the developer’s Magic Link token gets this for applications that already use Magic Link
      • While still a backend, Token scoping #314 gets us this with a minimal backend for users using any other authentication mechanism
    • Scope tokens to user specific interactions (don’t allow admin actions w/ only user authentication)

Until we do all 3 features we won’t hit all the users we want, so we need to make sure that we design the first one we decide to implement in such a way that it will be compatible with future methods:

  • When we write records for uploaded data we need to use a flat tagging system rather than treating applications, developers or end-users as a hierarchy.
    • We may also want to implement a broader generic tagging system as part of this feature so that we can namespace and protect “user:” or other tag prefixes we want for the service
  • When we scope the tokens we need to remember that this token may be used by us and other applications, so we probably can’t do “user” and “admin” because the permissions they get in our service and other services may not be identical. We probably need to do something like “w3s:user” if we can

@atopal
Copy link
Contributor

atopal commented Nov 26, 2021

Update:

  • We are pretty clear that signed uploads are a way to let end users upload to web3.storage, but that means that the developer of the app has control over the data.
  • We still need to decide how devs can create apps where end users can store with web3.storage without devs haivng control over the data

@Kirbyrawr
Copy link

Kirbyrawr commented Jan 3, 2022

Bumping this, my approach is as follows:

  • Every user is in charge of their own API Key.
  • Every user must follow the terms and service (decentralizing this part from the developer)
  • The user will need to input a password to encrypt (AES) the token. In my case the token will be stored in the user Stellar Account using a DataEntry operation
  • When the user wants to mint new NFT's (Talking in the case of nft.storage) the user will only need to login with their account (using the wallet) and input the password (in order to decrypt the token key retrieved from the blockchain), the app won't send the password to any server as the encrypt/decrypt ocurrs locally.

Here's a photo of a concept:
imagen

@dchoi27
Copy link
Contributor Author

dchoi27 commented Jan 3, 2022

Update here - we are proceeding with implementing UCAN-based auth in NFT.Storage, which will allow NFT.Storage users to delegate uploads to others (like their users). This is being tracked here: nftstorage/nft.storage#851

We'll implement this solution in Web3.Storage as well. It's important to note that this will likely require Web3.Storage users to have their own backend to allocate and manage delegated UCANs at first, but UCANs are a pretty general solution that could allow for backendless apps to be created as well if the right service layer is living somewhere. More on UCANs here: https://fission.codes/blog/auth-without-backend/

@dchoi27 dchoi27 changed the title Direct end-user interaction with web3.storage UCAN login with web3.storage Jan 11, 2022
@dchoi27 dchoi27 changed the title UCAN login with web3.storage UCAN-based authorized uploads with web3.storage Jan 11, 2022
@dchoi27 dchoi27 added the topic/pot Issues handled by PT. label Jan 21, 2022
@LeslieOA LeslieOA self-assigned this Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic kind/enhancement A net-new feature or improvement to an existing feature need/approach P1 High: Likely tackled by core team if no one steps up topic/pot Issues handled by PT.
Projects
None yet
Development

No branches or pull requests

5 participants