
Security News
Socket for Origin Now Available
Socket for Origin scans dependency changes in pull requests and flags security risks based on your team’s policies. Now available in Cursor’s App Marketplace.
fair-tools
Advanced tools
Tools for the FAIR protocol. Create keys, create and manage DIDs, and build signed metadata for WordPress plugins.
[!CAUTION]
This package is not production ready and is under heavy development. Do not use this unless you are comfortable testing the FAIR protocol and handling breaking changes.
[!IMPORTANT]
This is not an official FAIR tool.
Its license facilitates it being transferred to The FAIR Web Foundation at a later date should they wish.
npm install fair-tools
The basic steps to set up a plugin for distribution via FAIR are:
The initial setup of the DID only happens once. Subsequent updates to your plugin just require you to build the FAIR metadata for the package and publish it.
Creates a new FAIR DID and publishes it.
npx create-did --directory ./dids
This generates rotation and verification keypairs, creates a DID, publishes it to plc.directory, and writes the keys to <directory>/<did>.json with secure permissions (0600).
[!WARNING] Back up this file immediately! This file contains the private keys needed to manage your DID. If you lose this file, you will lose control of your DID permanently.
Manually add the new DID to the header of your plugin. The did:plc: prefix must be included.
* Plugin Name: My Plugin
+ * Plugin ID: did:plc:abcdefghijklmnopqrstuvwx
* Version: 1.0.0
Most subsequent commands after creating a DID require a signing key. There are two ways to provide one:
Key file: Use --signing-file to specify a JSON file containing your keys. Use --signing-key to select a specific key from the file (defaults to first key).
Environment variable: If --signing-file is not provided, the command falls back to an environment variable:
FAIR_PRIVATE_KEY for metadata signing (verification key)FAIR_ROTATION_KEY for DID operations (rotation key)Builds signed FAIR metadata for a WordPress plugin release.
npx build-metadata \
--did did:plc:xxx \
--plugin-file ./my-plugin/my-plugin.php \
--zip-file ./my-plugin.zip \
--url https://example.com/releases/my-plugin-1.0.0.zip \
--metadata-file ./metadata.json \
--output-file ./metadata.json
Updates a DID to add your FAIR service URL.
npx update-did \
--did did:plc:xxx \
--url https://example.com/did:plc:xxx/metadata.json
Over time you may need to manage the keys for your DID.
Adds a URL to the alsoKnownAs field of a DID.
npx add-aka \
--did did:plc:xxx \
--url at://example.com
Generates a new verification key, adds it to a DID, and saves it to the key file.
npx add-verification-key \
--did did:plc:xxx
Use --output-file to save the new key to a different file instead of the signing file.
Generates a new rotation key, adds it to a DID, and saves it to the key file.
npx add-rotation-key \
--did did:plc:xxx
Use --output-file to save the new key to a different file instead of the signing file.
Revokes a verification key from a DID.
npx revoke-verification-key \
--did did:plc:xxx \
--revoke did:key:z6Mk...
Use --cleanup to delete the revoked key from the key file after success.
Revokes a rotation key from a DID.
npx revoke-rotation-key \
--did did:plc:xxx \
--revoke did:key:zQ3sh...
You cannot revoke the key used to sign the operation, and at least one rotation key must remain.
When using --signing-file without --signing-key, defaults to signing with the first available rotation key that isn't being revoked.
Use --cleanup to delete the revoked key from the key file after success.
MIT
FAQs
Tools for the FAIR protocol
The npm package fair-tools receives a total of 0 weekly downloads. As such, fair-tools popularity was classified as not popular.
We found that fair-tools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Socket for Origin scans dependency changes in pull requests and flags security risks based on your team’s policies. Now available in Cursor’s App Marketplace.

Security News
Agent Baseline’s new reference architecture shows how to secure software factories with four boundaries enforced outside the AI agent.

Security News
arXiv now limits authors to two submissions a month as AI slop overwhelms moderators, delays good papers, and sparks debate over applying the limit to everyone.