# ExIpfsIpns

[![IPNS Unit and integration tests](](
[![Coverage Status](](

Elixir [IPNS][ipns] module. It is part of [ExIpfs][ex-ipfs] suite of modules.

[IPNS][ipns] provides mutable data structures in [IPFS][ipfs] by creating CIDs that are backed by PKI signing. As such they are self-certifying. A thought experiment could be to publish your GPG public key to your IPNS address. An IPNS address can be likened to a verified website with TLS, but where the signer is implicitly verified. Not as a legal entity, but as a key.

This module features both publication and key handling.

## Usage

  iex(1)> ExIpfsIpns.Key.gen("foo")
      name: "foo",
      id: "k51qzi5uqu5dhxwb3x7bjg8k73tlkaqfugy217mgpf3vpdmoqn9du2qp865ddv"
  iex(2)> ExIpfsIpns.Name.publish("/ipfs/QmWGeRAEgtsHW3ec7U4qW2CyVy7eA2mFRVbk1nb24jFyks", key: "foo")
      name: "k51qzi5uqu5dhxwb3x7bjg8k73tlkaqfugy217mgpf3vpdmoqn9du2qp865ddv",
      value: "/ipfs/QmWGeRAEgtsHW3ec7U4qW2CyVy7eA2mFRVbk1nb24jFyks"

  Then open your browser and browser to

   Your browser does support IPFS, doesn't it? :-)

### Keys

In the above example the key `foo` is the identity of your website. If you lose the key, you can't update the "web site" again. Ever. But if you do keep it safe, your "web site" is proofably yours. Or - someone who has the key's.

*NB!* Outside the scope of this module or documentation it is possible to link this into the DNS namespace by using TXT RRs. Eg.

```DNS TXT dnslink=/ipns/k51qzi5uqu5dh36vwqrwttjcrwrl1ao5a8qx8rg851rrftqgso4x0ty586f68h

This way, if you lose the key, you can just point your DNS RR to the new id of a new key. So there is that.

See the [DNSLINK documentation][dnslink] for this.

[ex-ipfs]: "Core Elixir IPFS module"
[ipfs]: "Interplanetary File System"
[ipns]: "Interplanetary Name System"
[dnslink]: "Link IPFS resources to DNS"