Content addressing for a dynamic web. Now available from Rust!
## About The `w3name` crate provides a client library for the w3name service, an implementation of the [IPNS](https://docs.ipfs.io/concepts/ipns/) decentralized naming protocol. For more about w3name in general, see the [main github repository](https://github.com/web3-storage/w3name). ## Install Add the `w3name` crate to your Cargo.toml: ```toml [dependencies] w3name = "0.1.0" ``` ### Native dependencies To install with `cargo`, you'll need the [Protocol Buffers compiler](https://grpc.io/docs/protoc-installation/), and the `protoc` command must be on your `$PATH`. Version `3.20.2` is known to work, and other 3.x versions are likely to work as well. If you can't install `protoc`, but you do have `cmake`, you can set the `protoc-src` feature, which will build the protobuf compiler from source at build time. You'll also need `perl`, since we build openssl from source, and `perl` is required by the build process. ## Usage There are two main types that represent "names": - `Name` is used to fetch and verify name records. It contains the public key for a name, but not the private key, and so cannot be used to publish records. - `WritableName` is used to sign records for publication. It contains the private key as well as the public key. Calling `to_name()` on a `WritableName` instance will return a `Name` containing just the public half of the keypair. ### Creating a `WritableName` To create a new name, use `WritableName::new()`, which will generate a new keypair. You can save this to disk by calling `keypair().to_protobuf_encoding()` on a `WritableName` instance, which will give you a `Vec