-
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
docs: add w3 space basic spec #93
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
# Space | ||
|
||
![status:reliable](https://img.shields.io/badge/status-reliable-green.svg?style=flat-square) | ||
|
||
## Editors | ||
|
||
- [Vasco Santos], [Protocol Labs] | ||
|
||
## Authors | ||
|
||
- [Vasco Santos], [Protocol Labs] | ||
|
||
## Abstract | ||
|
||
A Space can be defined as a namespace for stored content. It is created locally, offline, and associated with a cryptographic key pair (identified by the did:key of the public key). Afterwards, a space MAY be registered with a web3.storage [account](./w3-account.md) and [providers](./w3-provider.md) MAY be added to the space. | ||
|
||
- [Capabilities](#capabilities) | ||
- [`space/info`](#spaceinfo) | ||
- [`space/allocate`](#spaceallocate) | ||
|
||
## Language | ||
|
||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119](https://datatracker.ietf.org/doc/html/rfc2119). | ||
|
||
## Capabilities | ||
|
||
### `space/info` | ||
|
||
Get information about a given space, such as registered providers. | ||
|
||
> `did:key:zAliceAgent` invokes `space/info` capability provided by `did:web:web3.storage` | ||
|
||
```json | ||
{ | ||
"iss": "did:key:zAliceAgent", | ||
"aud": "did:web:web3.storage", | ||
"att": [ | ||
{ | ||
"with": "did:key:zAlice", | ||
"can": "space/info" | ||
} | ||
], | ||
"prf": [], | ||
"sig": "..." | ||
} | ||
``` | ||
|
||
#### Space Info Failure | ||
|
||
```json | ||
{ | ||
"ran": "bafy...spaceInfo", | ||
"out": { | ||
"error": { | ||
"name": "SpaceUnknown" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
#### Space Info Success | ||
|
||
```json | ||
{ | ||
"ran": "bafy...spaceInfo", | ||
"out": { | ||
"ok": { | ||
"did": "did:key:zAlice", | ||
"providers": [ | ||
"did:web:free.web3.storage" | ||
] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### `space/allocate` | ||
|
||
Allocate space to write content into the space | ||
|
||
> `did:key:zAliceAgent` invokes `space/allocate` capability provided by `did:web:web3.storage` | ||
|
||
```json | ||
{ | ||
"iss": "did:key:zAliceAgent", | ||
"aud": "did:web:web3.storage", | ||
"att": [ | ||
{ | ||
"with": "did:key:zAlice", | ||
"can": "space/allocate", | ||
"nb": { | ||
"size": 1000 | ||
} | ||
} | ||
], | ||
"prf": [], | ||
"sig": "..." | ||
} | ||
``` | ||
|
||
#### Space Allocate Failure | ||
|
||
```json | ||
{ | ||
"ran": "bafy...spaceAllocate", | ||
"out": { | ||
"error": { | ||
"name": "InsufficientStorage" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
#### Space Allocate Success | ||
|
||
```json | ||
{ | ||
"ran": "bafy...spaceAllocate", | ||
"out": { | ||
"ok": {} | ||
} | ||
} | ||
``` | ||
|
||
[Protocol Labs]: https://protocol.ai/ | ||
[Vasco Santos]: https://github.com/vasco-santos |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to document this? AFAIK it is not used by our client/server as an invoked capability...although the handler is used by
store/add
handler.However it doesn't do anything related to allocating space - it rate limits and checks for storage provider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is used by
store/add
yes. I think it should be documented, asstore/add
may happen in another place in the future.I think because it is not implemented? But that is the goal here? We can make that clear in the spec if that would be the desire.
Maybe @travis can help out with decision here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right but I think that should be in
w3-store.md
and should say thatstore/add
MAY rate limit and SHOULD ensure the space is provisioned properly.I would just remove it - it is not invoked and does nothing to do with allocating space. The handler function should instead be a lib/utility function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I removed until we decide what to do