-
Notifications
You must be signed in to change notification settings - Fork 0
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
Spaces are always available in the Console #124
Comments
This is odd. My impression was that a space with no "recovery" was not associated with the account (the The invocation returns results like:
What is that value for I still can't find where the names for the spaces I do see come from, which is even stranger to me. 😕 One more question: When creating a recovery, why is the " |
To answer your question, I want to run through a conceptual overview of how spaces are supposed to work. A space is just a namespace for files identified by a public key DID. When you create a space, a key pair is created in whatever agent (i.e. console, w3-cli, or the js-lib) you are running. Then absolute authority is delegated to the agent, and private key of the space is actually discarded. At this point, authority for the space is with the agent. There are now two SEPERATE categories of things I can do to expand what I can do with the space:
My agent is now fully in control of the space. Without without any involvement of web3.storage, I could share access to this space with another agent by producing and sharing a UCAN from my agent to the other agent delegating capabilities for the space. However, this would be super hard to manage for your average user. So we have another mechanism for sharing access. This is the account. And account is just a DID that's not did:key. I can make a UCAN delegation that goes from my agent did:key to the did:mailto for the account. That's what Then
Is simply invoking access/delegate that sends this UCAN delegation over the wire for this space. Now, on the other side, a new agent comes along who wants to get access to the spaces for the account they invoke then they can call Importantly, because the account did is a The delegations received with
All of the above have to do with delegating the ability to perform capabilities on a space. However, for capabilities to be invoked, you need a provider for those capabilities. So a space must be provisioned with a provider to do almost anything with it. When a space has a provider, storage commands (i.e. blob/add etc) invoked on a space routed to a provider to actually care them out. In this case, the provider is web3.storage/Storacha. The code in the JS lib tutorial is that connects the space to the provider: await myAccount.provision(space.did()) Under the hood it calls While web3.storage is the only provider, anyone could build a different provider by meeting the capabilities. And theoretically a provider could just be a local disk. Obviously the most confusing thing here is that it says All of this is a long way of saying: |
You might also say: why so complicated? Well, there are certainly cases where different agents shouldn't have access to all spaces in an account. One form or another of this is what happens with large applications that have one account with us but let their users upload to a single space in their account. In this case, the ucans are transmitted directly to the client for certain spaces, without I don't exactly know why you wouldn't want those still to have a recovery for someone with full access to the account, so again, I think the default flow should automatically create a recovery. |
@alanshaw I'd love your comments on whether all the above is correct. |
Excellent. That's all super helpful and fits with my understanding. But I have some more questions:
|
|
One piece I think is perhaps confusing providers sell plans to an account. But an account is just an email. One account can have as many providers as it likes. |
I think most of my concern comes down to a confusion or conflation between several roles that Storacha (currently) plays:
Those roles are currently all served by the same service, but (I believe) don't need to be, and I have a sense we want to divide the third role up a bit further. If these aren't separate roles, all of this UCAN business seems incredibly overwrought: we're specifically trying to decentralize this system. If they are separate roles, then we have a surprising amount of trust between the roles, or I'm missing something. |
Hoooooold up:
Does someone delegate authority to Storacha to attest the delegation from the Account to the Agent? |
ChangesThe
This update removes the need for manual steps, ensuring the recovery account is set up as part of the space creation process. PRs: |
Issue storacha/project-tracking#124 # Current Workflow (CLI) ### `w3cli` Project The [`space.create(name, options)`](https://github.com/storacha-network/w3cli/blob/3f59da7b096a63f14def9946682160fefacd0702/space.js#L24) function in `space.js` allows the user to pass the following options: - **recovery**: `false` (default) - **caution**: `false` (default) - **customer**: `Email | false` - **account**: `string | false` If the `account` attribute is provided, the following steps are triggered: 1. `space.createdRecovery` is called. 2. Then, `client.capabilities.access.delegate` is executed. This process occurs during **space creation**, not during provisioning. Provisioning only happens when the `customer` attribute is provided in the `options` argument. --- # Issue (JS Client) ### `w3up` Project The [`client.createSpace(name)`](https://github.com/storacha-network/w3up/blob/fb8b8677c4c633cdf8c259db55357a1794eed3ab/packages/w3up-client/src/client.js#L239) function in the `w3up` project currently does **not** accept any options, which means the recovery account must be created manually **after** space creation and provisioning. This introduces a risk of forgetting the manual step and potentially losing access to the space. --- # Expected Outcome We propose a small modification to the `client.createSpace(name)` function to support optional parameters, allowing clients to pass an `account` directly, automating the recovery setup. ### Solution: - Clients can now call `client.createSpace(name, { account })` to include the `account` in the creation process. - This ensures that the recovery account is created immediately after the space is created, provisioned, and saved, eliminating the need for a manual step. ### Benefits: - **Backward Compatibility**: The change does not break existing client implementations since the `account` parameter is optional, keeping calls like `client.createSpace(name)` intact. - **Simplified Workflow**: By simply passing the `account` when calling `createSpace`, the recovery account setup is handled automatically during space creation. - **Flexibility**: If needed in the future, the `account` attribute can be made required to enforce stricter recovery account management. --------- Signed-off-by: Felipe Forbeck <[email protected]> Co-authored-by: Alan Shaw <[email protected]>
Acceptance Criteria
Notes
Follow the steps in the docs, except for adding the recovery at the end. Essentially, as of this issue, the client should do that last step automatically.
The text was updated successfully, but these errors were encountered: