npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tangle.js/ld-proofs

v0.9.2

Published

Linked Data Proofs on the Tangle. Powered by IOTA Identity & IOTA Streams

Readme

Tangle Linked Data Proofs

ld-proofs enables Linked Data Proofs on the Tangle. Powered by IOTA Identity and IOTA Streams.

How it works

Aligned with the W3C Linked Data Proofs proposed specification this library allows the generation and verification of Linked Data Proofs associated to plain messages or JSON(-LD) documents. Different kinds of Linked Data Proofs can be generated:

  • EdDSA (Ed25519) Signatures over plain messages
  • Linked Data Signatures for JSON-LD Documents Ed25519Signature2018
  • Linked Data Signatures for JSON Documents JcsEd25519Signature2020
  • Linked Data Proofs anchored to the Tangle (using the anchors library). The proof's type is IotaLinkedDataProof2021. This type of proof anchors to the Tangle a Linked Data Signature together with a reference to the signed document.

The identities and their corresponding public key materials follow the W3C DID specification.

API

Linked Data Signature generation (Ed25519 over JSON(-LD))

const did = "did:iota:2pu42SstXrg7uMEGHS5qkBDEJ1hrbrYtWQReMUvkCrDP";
// Default node is IF Chrysalis Nodes
const signer = await IotaSigner.create(did, node?);

const jsonLdDocument = {
    "@context": "https://schema.org",
    "type": "Organization",
    "name": "IOTA Foundation"
};

const options: ISigningOptions = {
    verificationMethod,
    secret: privateKey,
    signatureType: "Ed25519Signature2018"
};
// Obtains a Linked Data Signature
const ldSignature = signer.signJsonLd(jsonLdDocument, options);

Linked Data Signatures verification (Ed25519 over JSON(-LD) objects)

// The document includes the former document and the Linked Data Signature
const signedDoc = {
    "@context": "https://schema.org",
    "type": "Organization",
    "name": "IOTA Foundation",
    "proof": {
        "proofValue": "3JTS3UaJc2aS2rxkQ1Z4GEs9HjvASnm3e2s5VT5pS8voGEBodWBBd6P7YUmq8eN92H9v1u2gmqER7Y6wXhgcywYX",
        "type": "Ed25519Signature2018",
        "verificationMethod": "did:iota:2pu42SstXrg7uMEGHS5qkBDEJ1hrbrYtWQReMUvkCrDP#key",
        "proofPurpose": "dataVerification",
        "created": "2021-06-21T13:29:25.976Z"
    }
};

// True if verified. False otherwise. 
const verified = await IotaVerifier.verifyJsonLd(signedDoc);

Linked Data Proofs generation (anchored to the Tangle)

See the anchors library and the IotaSigner class.

const anchorChannel = /* Instantiate an anchoring channel */
const signer = /* Instantiate a signer */
const proofGenerator = IotaLdProofGenerator.create(anchoringChannel, signer);
// Generates the Linked Data Signature and anchors it to the Tangle generating 
// an Iota proof
const tangleProof = await proofGenerator.generateLd(jsonLdDocument, {
    verificationMethod,
    secret,
    signatureType: "Ed25519Signature2018"
    anchorageID: anchoringChannel.firstAnchorageID
});

Linked Data Proofs verification

const anchoredDoc = {
    "@context": "https://schema.org",
    "type": "Organization",
    "name": "IOTA Foundation",
    "proof": {
        "type": "IotaLinkedDataProof2021",
        "verificationMethod": "did:iota:yUxEqDGgL2WF4sQq2TEzdmDjDkRsHKL5TcLWrdAjmb4",
        "proofPurpose": "dataVerification",
        "proofValue": {
            "channelID": "1761e16e50dd6c95f7155979b5691b0a4390559f6ff0287a297cc2ae818312c40000000000000000:7bc48fb8fe5dccdb81dd5dcd",
            "anchorageID": "e7b123ed4c6a803538a52233",
            "msgID": "1fa6dde995dd6320bc0f7958"
        },
        "created": "2021-07-01T10:21:50.338Z"
    }
};
const verified = await IotaLdProofVerifier.verifyJsonLd(anchoredDoc);

Signing plain messages

Only EdDSA (Ed25519) is supported.

// The node is optional and by default will be IF mainnet nodes
const node = "https://chrysalis-nodes.iota.org";

// The DID contains the public cryptographic materials used by the signer
const did = "did:iota:2pu42SstXrg7uMEGHS5qkBDEJ1hrbrYtWQReMUvkCrDP";
const signer = await IotaSigner.create(did);

// Plain message to be signed
const message = "hello";

// Method declared on the signer's concerned DID document
const method = "key";
// Private Key in base58
const privateKey = "privateKeybase58";

const options: ISigningOptions = {
    verificationMethod: method,
    secret: privateKey
};

const signingResult = await signer.sign(Buffer.from(message), options);
console.log("Signature: ", signingResult.signatureValue);

Verifying plain messages

const options: IVerificationOptions = {
    verificationMethod: "did:iota:2pu42SstXrg7uMEGHS5qkBDEJ1hrbrYtWQReMUvkCrDP#key",
    // Node is optional and it is IOTA's mainnet by default
    node: "https://chrysalis-nodes.iota.org"
};

const verified = await IotaVerifier.verify(message, signatureValue, options);