Détail du package

ipns

ipfs101.2kApache-2.0 OR MIT10.0.2

IPNS record definitions

ipfs, ipns

readme

ipns

ipfs.tech Discuss codecov CI

IPNS Record definitions

Table of contents

Install

$ npm i ipns

Browser <script> tag

Loading this module through a script tag will make it's exports available as Ipns in the global namespace.

<script src="https://unpkg.com/ipns/dist/index.min.js"></script>

This module contains all the necessary code for creating, understanding and validating IPNS records.

Usage

Create record

import * as ipns from 'ipns'

const ipnsRecord = await ipns.createIPNSRecord(privateKey, value, sequenceNumber, lifetime)

Validate record against public key

import { validate } from 'ipns/validator'

await validate(publicKey, marshalledRecord)
// if no error thrown, the record is valid

Validate record against routing key

This is useful when validating IPNS names that use RSA keys, whose public key is embedded in the record (rather than in the routing key as with Ed25519).

import { ipnsValidator } from 'ipns/validator'

await ipnsValidator(routingKey, marshalledRecord)

Extract public key from record

import * as ipns from 'ipns'

const publicKey = await ipns.extractPublicKeyFromIPNSRecord(peerId, ipnsRecord)

Marshal data with proto buffer

import * as ipns from 'ipns'

const ipnsRecord = await ipns.createIPNSRecord(privateKey, value, sequenceNumber, lifetime)
// ...
const marshalledData = ipns.marshalIPNSRecord(ipnsRecord)
// ...

Returns the record data serialized.

Unmarshal data from proto buffer

import * as ipns from 'ipns'

const ipnsRecord = ipns.unmarshalIPNSRecord(storedData)

Returns the IPNSRecord after being deserialized.

API Docs

Namespace

Namespace constants for records.

ipns.namespace

// '/ipns/'
ipns.namespaceLength

// 6

License

Licensed under either of

Contribute

Contributions welcome! Please check out the issues.

Also see our contributing document for more information on how we work, and about contributing in general.

Please be aware that all interactions related to this repo are subject to the IPFS Code of Conduct.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

changelog

10.0.2 (2025-03-18)

Bug Fixes

  • align implicit default ttl with specs (1h→5m) (#336) (5677cf0)

Trivial Changes

Dependencies

  • dev: bump aegir from 44.1.4 to 45.0.8 (#332) (c2d611a)

10.0.1 (2025-02-11)

Documentation

10.0.0 (2024-09-12)

⚠ BREAKING CHANGES

  • uses libp2p@2.x.x deps, operates on PrivateKey/PublicKeys instead of PeerIds

Bug Fixes

9.1.2 (2024-09-12)

Bug Fixes

9.1.1 (2024-09-11)

Dependencies

  • dev: bump aegir from 42.2.11 to 44.1.1 (#321) (e06942b)

9.1.0 (2024-04-02)

Features

Trivial Changes

  • add or force update .github/workflows/js-test-and-release.yml (#311) (0c5f3e1)
  • add or force update .github/workflows/js-test-and-release.yml (#312) (46a2b72)
  • add or force update .github/workflows/js-test-and-release.yml (#313) (e933496)
  • Update .github/workflows/stale.yml [skip ci] (16e0e10)

9.0.0 (2024-01-18)

⚠ BREAKING CHANGES

  • the validity field is now a string

Bug Fixes

8.0.4 (2024-01-18)

Bug Fixes

8.0.3 (2024-01-16)

Bug Fixes

8.0.2 (2024-01-15)

Dependencies

  • bump @libp2p/crypto from 3.0.4 to 4.0.0 (#304) (ed83244)

8.0.1 (2024-01-12)

Trivial Changes

  • Update .github/workflows/stale.yml [skip ci] (e612553)

Dependencies

  • dev: bump aegir from 41.3.5 to 42.1.1 (#303) (9f0ab52)

8.0.0 (2023-12-30)

⚠ BREAKING CHANGES

  • requires libp2p v1 or later

Trivial Changes

Dependencies

7.0.2 (2023-12-30)

Dependencies

  • bump uint8arrays from 4.0.10 to 5.0.1 (#297) (6043eab)

7.0.1 (2023-09-15)

Bug Fixes

  • add extra signature for empty options object (#260) (ecbc699)

7.0.0 (2023-09-15)

⚠ BREAKING CHANGES

  • all /ipns/* keys are now encoded as base36 encoded CIDv1 libp2p-cid

Features

  • opt-in V2-only records, IPIP-428 verification (#234) (df71fed), closes #217

6.0.7 (2023-09-14)

Bug Fixes

  • update libp2p interfaces to the latest version (#259) (65f9d9b)

Trivial Changes

6.0.6 (2023-09-14)

Dependencies

6.0.5 (2023-08-24)

Dependencies

  • bump @libp2p/peer-id from 2.0.4 to 3.0.2 (#250) (69c52d7)

6.0.4 (2023-08-24)

Trivial Changes

  • add or force update .github/workflows/js-test-and-release.yml (#247) (3d3807f)
  • delete templates [skip ci] (#246) (c57dd46)
  • Update .github/workflows/stale.yml [skip ci] (5139ee5)
  • Update .github/workflows/stale.yml [skip ci] (70735d1)

Dependencies

  • bump @libp2p/crypto from 1.0.17 to 2.0.3 (#249) (b12b1f7)
  • bump @libp2p/logger from 2.1.1 to 3.0.2 (#254) (73ba154)
  • bump cborg from 1.10.2 to 2.0.4 (#252) (2c4d575)
  • bump multiformats from 11.0.2 to 12.0.1 (#229) (656fe3d)
  • dev: bump @libp2p/peer-id-factory from 2.0.4 to 3.0.3 (#251) (c6acf18)
  • dev: bump aegir from 39.0.13 to 40.0.11 (#253) (45d81d7)

6.0.3 (2023-06-14)

Bug Fixes

Documentation

6.0.2 (2023-06-14)

Bug Fixes

6.0.1 (2023-06-14)

Dependencies

  • dev: bump aegir from 38.1.8 to 39.0.10 (#225) (1c9fce1)

6.0.0 (2023-03-21)

⚠ BREAKING CHANGES

  • bump interface-datastore from 7.0.4 to 8.1.0 (#215)

Dependencies

  • bump interface-datastore from 7.0.4 to 8.1.0 (#215) (100799c)
  • bump protons-runtime from 4.0.2 to 5.0.0 (#201) (60c3a15)
  • dev: bump protons from 6.1.3 to 7.0.2 (#204) (eb05501)

5.0.2 (2023-03-21)

Dependencies

  • dev: bump aegir from 37.12.1 to 38.1.7 (#211) (9b7cca0)

5.0.1 (2023-01-07)

Documentation

5.0.0 (2023-01-07)

⚠ BREAKING CHANGES

  • update multiformats to v11 (#196)

Dependencies

4.0.0 (2022-10-17)

⚠ BREAKING CHANGES

  • update multiformats, protons and uint8arrays (#189)

Dependencies

  • update multiformats, protons and uint8arrays (#189) (645c3b8)

3.0.0 (2022-09-20)

⚠ BREAKING CHANGES

  • IPNS V1 signatures are ignored, records without V2 signature are no longer marked as Valid.

Bug Fixes

2.0.3 (2022-08-14)

Bug Fixes

2.0.2 (2022-08-14)

Dependencies

  • bump interface-datastore from 6.1.1 to 7.0.0 (#176) (7f8caa0)

2.0.1 (2022-08-11)

Trivial Changes

  • Update .github/workflows/stale.yml [skip ci] (116d5ec)
  • update project config (#174) (5200b95)

Dependencies

2.0.0 (2022-06-28)

⚠ BREAKING CHANGES

  • update to new libp2p interface versions

Features

1.0.2 (2022-05-25)

Trivial Changes

  • deps: bump @libp2p/interfaces from 1.3.32 to 2.0.2 (#159) (0f4bb9f)

1.0.1 (2022-05-10)

Bug Fixes

1.0.0 (2022-04-13)

⚠ BREAKING CHANGES

  • this module is now ESM-only

Features

0.16.0 (2021-12-02)

chore

BREAKING CHANGES

  • requires node 15+

0.15.1 (2021-11-30)

0.15.0 (2021-09-14)

0.14.1 (2021-09-10)

chore

BREAKING CHANGES

  • deep imports/requires are no longer possible

0.14.0 (2021-09-02)

Bug Fixes

BREAKING CHANGES

  • extractPublicKey is now async

0.13.4 (2021-08-19)

Bug Fixes

0.13.3 (2021-08-11)

Bug Fixes

0.13.2 (2021-07-12)

Bug Fixes

  • parse peer id from message correctly (#127) (d7c8e51)

chore

BREAKING CHANGES

  • uses new peer-id class and supporting ecosystem modules

0.13.1 (2021-07-10)

0.13.0 (2021-07-09)

chore

BREAKING CHANGES

  • uses new peer-id class and supporting ecosystem modules

0.12.0 (2021-06-10)

Features

0.11.0 (2021-04-21)

Bug Fixes

BREAKING CHANGES

  • ipns validate function returns a void promise instead of boolean promise

0.10.2 (2021-04-15)

0.10.1 (2021-04-13)

Bug Fixes

0.10.0 (2021-03-10)

Bug Fixes

BREAKING CHANGES

  • strings are no longer accepted as valid values to publish

0.9.1 (2021-03-09)

Bug Fixes

0.9.0 (2021-03-05)

Features

0.8.2 (2021-01-19)

0.8.1 (2020-12-22)

0.8.0 (2020-08-14)

Bug Fixes

  • replace node buffers with uint8arrays (#67) (06ee535)

BREAKING CHANGES

    • All deps of this module use Uint8Arrays instead of Buffers
  • value and validity fields of IPNSEntries are now Uint8Arrays instead of Strings as they are bytes in the protobuf definition

0.7.4 (2020-08-06)

0.7.3 (2020-06-22)

Bug Fixes

0.7.2 (2020-05-12)

Bug Fixes

  • ci: add empty commit to fix lint checks on master (929525f)

0.7.1 (2020-04-24)

Bug Fixes

0.7.0 (2019-12-18)

Bug Fixes

0.6.1 (2019-09-25)

0.6.0 (2019-07-19)

Chores

BREAKING CHANGES

  • All places in the API that used callbacks are now replaced with async/await

0.5.2 (2019-05-23)

Bug Fixes

0.5.1 (2019-04-03)

Bug Fixes

BREAKING CHANGES

  • method createWithExpiration signature changed

expiration param changed from time of the record (in nanoseconds) to datetime for record in the [RFC3339]{@link https://www.ietf.org/rfc/rfc3339.txt} with nanoseconds precision

0.5.0 (2019-01-10)

Bug Fixes

BREAKING CHANGES

  • method createWithExpiration signature changed

expiration param changed from time of the record (in nanoseconds) to datetime for record in the [RFC3339]{@link https://www.ietf.org/rfc/rfc3339.txt} with nanoseconds precision

0.4.4 (2019-01-04)

0.4.3 (2018-11-30)

0.4.2 (2018-11-29)

Bug Fixes

  • validator select should return if no callback (#15) (0845877)

0.4.1 (2018-11-26)

0.4.0 (2018-11-16)

Bug Fixes

BREAKING CHANGES

  • having the libp2p-record protobuf definition compliant with go-libp2p-record. Author and signature were removed.

0.3.0 (2018-10-26)

0.2.2 (2018-10-25)

0.2.1 (2018-09-24)

Features

  • add creatWithExpiration function (#9) (576bc1a)

0.2.0 (2018-09-20)

0.1.6 (2018-09-07)

Bug Fixes

0.1.5 (2018-09-06)

Bug Fixes

0.1.4 (2018-09-06)

Bug Fixes

  • security: ensure validate is properly checking verify status (33684e3)

Features

0.1.3 (2018-08-23)

Bug Fixes

  • security: ensure validate is properly checking verify status (33684e3)

0.1.2 (2018-08-09)

Bug Fixes

Features

0.1.1 (2018-06-29)

Features