did:mailto
The "@web3-storage/did-mailto" Node module is a vital tool for developers working within the decentralized web space, specifically those leveraging the capabilities of Web3.Storage. This npm package is intricately designed to integrate with the UCAN protocol, ensuring that users can manage decentralized identities effectively. By utilizing this package, developers can streamline the process of handling decentralized identifiers (DIDs) that use the mailto method, a novel approach in the realm of decentralized identity management. This package not only simplifies the development process but also enhances security and user sovereignty over personal data.
For developers eager to integrate this functionality into their projects, the command npm install @web3-storage/did-mailto is all you need to get started. This installation process is straightforward, allowing developers to quickly incorporate the package into their applications. Once installed, the package facilitates the creation, resolution, and management of DIDs using the mailto method, directly linking email addresses with decentralized identities. This feature is particularly beneficial for applications requiring a bridge between traditional email communications and decentralized identity verification processes.
The benefits of using "@web3-storage/did-mailto" extend beyond just technical integrations. For end-users, the association of an email address with a DID through the mailto method enhances the usability of decentralized applications (dApps) by providing a familiar point of contact. This familiarity is crucial for fostering greater adoption of dApps and Web3 technologies among a broader audience. Moreover, the package's adherence to the UCAN protocol specifications ensures that it remains at the forefront of decentralized authentication and authorization technologies, making it an indispensable tool for developers aiming to build secure and user-centric Web3 applications.
Core dependencies of this npm package and its dev dependencies.
depcheck, typedoc-plugin-missing-exports, @arethetypeswrong/cli, @docusaurus/core, @docusaurus/preset-classic, docusaurus-plugin-typedoc, lint-staged, prettier, react, typedoc, typedoc-plugin-markdown, typescript
A README file for the @web3-storage/did-mailto code repository. View Code
w3up
This repo implements the web3.storage UCAN protocol specifications.
It's the core of the web3.storage server and client implementations.
Store your files with web3.storage and retrieve them via their unique Content ID. Our tools make it simple to hash your content locally, so you can verify the service only ever stores the exact bytes you asked us to. Pick the method of using web3.storage that works for you!
Visit https://console.web3.storage and upload right from the website.
Under the hood it uses the web3.storage client that we publish to npm to chunk and hash your files to calculate the root IPFS CID in your browser before sending them to https://up.web3.storage.
Once uploaded you can fetch your data from any IPFS gateway via https://w3s.link/ipfs/<root cid>
Install @web3-storage/w3cli
globally, authorize it to act on your behalf, create a space and upload your files. It calculates the root CID for your files locally before sending them to web3.storage.
shell
# verify your email to sync your existing ucan delegations to this agent.
$ w3 login alice@example.com
# create a Space, a DID namespace for your files... like a bucket.
$ w3 space create Documents
# lets go!
$ w3 up ~/Pictures/ayy-lamo.jpg
⁂ Stored 1 file
⁂ https://w3s.link/ipfs/bafybeid6gpbsqkpfrsx6b6ywrt24je4xqe4eo4y2wldisl6sk7byny5uky
Run w3 --help
or have a look at https://github.com/web3-storage/w3cli to find out everything it can do.
Add the @web3-storage/w3up-client
module into your project with npm i @web3-storage/w3up-client
and upload a single file with client.uploadFile
or many with client.uploadDirectory
.
If you've already got a space you can upload like this:
node.js
import { filesFromPaths } from 'files-from-path'
import * as Client from '@web3-storage/w3up-client'
const [,,yourEmail, pathToAdd] = process.argv
// authorize your local agent to act on your behalf
const client = await Client.create()
await client.login(yourEmail)
// lets go!
const files = await filesFromPaths(pathToAdd)
const cid = await client.uploadDirectory(files)
console.log(`IPFS CID: ${cid}`)
console.log(`Gateway URL: https://w3s.link/ipfs/${cid}`)
See https://web3.storage/docs/w3up-client for a guide to using the js client for the first time.
For an interactive command line adventure into the using w3up check out learnyouw3up
here https://github.com/web3-storage/learnyouw3up
The Action add-to-web3
wraps w3cli
to let you add files to web3.storage from your GitHub Workflows.
github-workflow.yaml
- run: npm run build # e.g output your static site to `./dist`
- uses: web3-storage/add-to-web3@v3.0.0
id: w3up
with:
path_to_add: 'dist'
secret_key: ${{ secrets.W3_PRINCIPAL }}
proof: ${{ secrets.W3_PROOF }}
- run: echo ${{ steps.w3up.outputs.cid }}
# "bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am"
- run: echo ${{ steps.w3up.outputs.url }}
# "https://dweb.link/ipfs/bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbauguluen5v6am"
To generate a secret_key
and delegate permissions to it as a proof
to use in CI see: https://github.com/web3-storage/add-to-web3#generating-a-secret_key-and-proof
All welcome! web3.storage is open-source. See the contributing guide
This project uses node v18 and pnpm
. It's a monorepo that uses pnpm workspaces to handle resolving dependencies between the local packages
Dual-licensed under MIT + Apache 2.0