Skip to content

Commit

Permalink
add implementations for w3-account.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gobengo committed Jan 19, 2024
1 parent 7dc291d commit 97d221c
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions w3-account.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Account

![status:wip](https://img.shields.io/badge/status-wip-orange.svg?style=flat-square)
![status=reliable](https://img.shields.io/badge/status-reliable-green.svg?style=flat-square)

## Editors

Expand All @@ -25,7 +25,9 @@ In w3 family of protocols, a namespace is identified by a [`did:key`] identifier
1. Synchronizing delegations to namespaces across multiple user agents on multiple devices is difficult because of the use of non-memorable [`did:key`] identifiers.
2. Recovering access if the user loses access to all devices is also a challenge.

To address these issues, we propose the concept of an account as a way to aggregate and manage capabilities under a human-meaningful identifier such as an email address. Specifically, we propose deriving an account identifier from a user-controlled email address in the form of a [`did:mailto`] identifier, which can act as the [principal] in [UCAN] delegation chains.
To address these issues, we propose the concept of an account as a way to aggregate and manage capabilities under a human-meaningful identifier such as an email address.

Specifically, with did:mailto Accounts we propose deriving an account identifier from a user-controlled email address in the form of a [`did:mailto`] identifier, which can act as the [principal] in [UCAN] delegation chains.

Using an account identifier based on a memorable email address solves the discovery problem, and email-based authorization flows provide a smoother onboarding experience by hiding the complexity of [PKI]. With this approach, users can aggregate all of their delegations under a single account identifier and re-delegate desired capabilities to other agents.

Expand Down Expand Up @@ -141,6 +143,37 @@ The authorization session signature is denoted by a [Nonstandard `VarSig` signat
{ "/": { "bytes": "gKADAA" } }
```

## Implementations

### [`w3 login <email>` in w3cli](https://github.com/web3-storage/w3cli#w3-login-email)

* invokes [Account.login](https://github.com/web3-storage/w3cli/blob/fc97ee1b76551bced861f08a4d1e7a31440a6a14/bin.js#L56) which calls `login` on a `@web3-storage/w3up-client`

Check failure on line 150 in w3-account.md

View workflow job for this annotation

GitHub Actions / markdown-link-check

Unordered list style [Expected: dash; Actual: asterisk]

w3-account.md:150:1 MD004/ul-style Unordered list style [Expected: dash; Actual: asterisk]

### [@web3-storage/w3up-client]()

Check failure on line 152 in w3-account.md

View workflow job for this annotation

GitHub Actions / markdown-link-check

No empty links [Context: "[@web3-storage/w3up-client]()"]

w3-account.md:152:5 MD042/no-empty-links No empty links [Context: "[@web3-storage/w3up-client]()"]

* login method [returns](https://github.com/web3-storage/w3up/blob/main/packages/w3up-client/src/account.js#L82) an `Account` instance

Check failure on line 154 in w3-account.md

View workflow job for this annotation

GitHub Actions / markdown-link-check

Unordered list style [Expected: dash; Actual: asterisk]

w3-account.md:154:1 MD004/ul-style Unordered list style [Expected: dash; Actual: asterisk]
* [used](https://github.com/web3-storage/w3cli/blob/fc97ee1b76551bced861f08a4d1e7a31440a6a14/account.js#L1) by w3cli

Check failure on line 155 in w3-account.md

View workflow job for this annotation

GitHub Actions / markdown-link-check

Unordered list style [Expected: dash; Actual: asterisk]

w3-account.md:155:1 MD004/ul-style Unordered list style [Expected: dash; Actual: asterisk]

Check failure on line 155 in w3-account.md

View workflow job for this annotation

GitHub Actions / markdown-link-check

Unordered list indentation [Expected: 2; Actual: 4]

w3-account.md:155:1 MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]

### [@ucanto/*](https://github.com/web3-storage/ucanto/tree/main)

ucanto contains all kinds of tools for building application layer services aligned with the w3-account model.

Examples
* [@web3-storage/upload-api](https://github.com/web3-storage/w3up/tree/main/packages/upload-api) - application logic for up.web3.storage

Check failure on line 162 in w3-account.md

View workflow job for this annotation

GitHub Actions / markdown-link-check

Unordered list style [Expected: dash; Actual: asterisk]

w3-account.md:162:1 MD004/ul-style Unordered list style [Expected: dash; Actual: asterisk]

Check failure on line 162 in w3-account.md

View workflow job for this annotation

GitHub Actions / markdown-link-check

Lists should be surrounded by blank lines [Context: "* [@web3-storage/upload-api](h..."]

w3-account.md:162 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "* [@web3-storage/upload-api](h..."]
* `createServer` [uses `@ucanto/server`](https://github.com/web3-storage/w3up/blob/main/packages/upload-api/src/lib.js#L29)

Check failure on line 163 in w3-account.md

View workflow job for this annotation

GitHub Actions / markdown-link-check

Unordered list style [Expected: dash; Actual: asterisk]

w3-account.md:163:1 MD004/ul-style Unordered list style [Expected: dash; Actual: asterisk]

Check failure on line 163 in w3-account.md

View workflow job for this annotation

GitHub Actions / markdown-link-check

Unordered list indentation [Expected: 2; Actual: 4]

w3-account.md:163:1 MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 4]
* example [invocation handler for `access/delegate`](https://github.com/web3-storage/w3up/blob/main/packages/upload-api/src/access/delegate.js#L17) using `@ucanto/types`

Check failure on line 164 in w3-account.md

View workflow job for this annotation

GitHub Actions / markdown-link-check

Unordered list style [Expected: dash; Actual: asterisk]

w3-account.md:164:1 MD004/ul-style Unordered list style [Expected: dash; Actual: asterisk]
* [@web3-storage/access-client](https://github.com/web3-storage/w3up/tree/main/packages/access-client) - uses `@ucanto/client` to invoke `@web3-storage/upload/api`

### [@web3-storage/did-mailto](https://github.com/web3-storage/w3up/tree/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/did-mailto)

* `fromEmail` and `toEmail` functions to encoded/decode `did:mailto` from email addresses.
* has `import("@web3-storage/did-mailto/types").DidMailto` typescript type

Examples
* [@web3-storage/w3cli for account management cli](https://github.com/web3-storage/w3cli/blob/fc97ee1b76551bced861f08a4d1e7a31440a6a14/account.js#L3)
* [@w3up-client](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/w3up-client/src/types.ts#L18)


[Protocol Labs]:https://protocol.ai/
[Irakli Gozalishvili]:https://github.com/Gozala
[PKI]:https://en.wikipedia.org/wiki/Public_key_infrastructure
Expand Down

0 comments on commit 97d221c

Please sign in to comment.