Fabric & Nostr

Fabric is an open DHT network for Nostr and Spaces to let you discover records and relay information using a sovereign handle or by a public key.

It’s possible to store and then retrieve Nostr events from Fabric. They can be anchored to spaces (and subspaces) thus
proving that the event was authored by the current owner of some space.

How to store an event in Fabric

You need to have Fabric installed and also to own a space.

Take a Nostr event:

$cat myevent.json
{
  "kind":15555,
  "created_at":1756219586,
  "content":"this is an example event",
  "tags":[]
}

Next you can sign it and anchor the event to your space.

$ space-cli --rpc-user username --rpc-password rpcpassword signevent @cosmos --input my_event.json --anchor > signed_event.json

--anchor flag tells spaced to include the proof field in the event, otherwise it is just signed with a key connected
to a provided space.

The signed event looks like this:

{
  "id": "d18ca7bb1137ee81873f8fe43a11c8826bb525b8ff56dbafcd7e2dac971e5afd",
  "pubkey": "4e6068ae6a082ac3f084e7f026640231e483fff449aaa69707b0d439c81a253c",
  "created_at": 1756219586,
  "kind": 15555,
  "tags": [
    [
      "s",
      "@cosmos"
    ]
  ],
  "content": "",
  "sig": "87370c99ce1800e5cc4825b9fbb07d261bcc5c23a829779df5cc714ade7279ed2dd414ddbd8cc74568a3689d2107ef8048c6a42bb0256c0bbdcecd29cdcc662d",
  "proof": "AQEAAtc4h8Lse5WiUwgciQziVvyesBWbkLvwBpWwQxkOViVCAQABAALnTIkfEDsxip3Vw0szL/ETJJdwXG2kZ8xSijhsuV1aDABWEAMsVSWKRLVSxkiVq7B9jTwtgc/IaNf+2xiEs+4DqwA0AQEGY29zbW9zAfvT1AD7mgIiUSBOYGiuaggqw/CE5/AmZAIx5IP/9EmqppcHsNQ5yBolPAJfm/Sw9kwFpkzxX+0s037PSfrYEg5PLg2sGk0wOnpDiw=="
}

Now it’s possible to publish the signed event to Fabric.
After installing Fabric, set the root anchors (the trie root to which the proofs commit), they can be specified as a flag or set as environment variable
FABRIC_REMOTE_ANCHORS="http://username:rpcpassword@127.0.0.1:7225/root-anchors.json"

The best option is to have spaced running locally, but also there are 2 remote root anchors providers:

  1. Bitpki - https://bitpki.com/root-anchors.json
  2. Spaces block explorer - https://explorer.spacesprotocol.org/api/root-anchors.json

Use fabric beam command to publish the event:

$ beam publish signed_event.json --remote-anchors http://username:rpcpassword@127.0.0.1:7225
[2025-08-30T05:08:17.887Z] Fetching anchors from: http://username:rpcpassword@127.0.0.1:7225/root-anchors.json
[2025-08-30T05:08:17.928Z] Anchors refreshed, latest block 912316
✓ Published 4e6068ae6a082ac3f084e7f026640231e483fff449aaa69707b0d439c81a253c (kind: 15555)

The event can be retrieved with the following command:

beam @cosmos 15555 --remote-anchors http://username:rpcpassword@127.0.0.1:7225

Fabric-connected Nostr relay.

Events stored in Fabric can be retrieved using a customized Nostr relay hosted at wss://nostr.spacesprotocol.org/relay.

It responds to usual Nostr queries, but in addition looks for events in Fabric:

websocat wss://nostr.spacesprotocol.org/relay
["REQ", "foo", {"kinds":[15555], "#s":["@cosmos"]}]
["EVENT","foo",{"id":"d18ca7bb1137ee81873f8fe43a11c8826bb525b8ff56dbafcd7e2dac971e5afd","pubkey":"4e6068ae6a082ac3f084e7f026640231e483fff449aaa69707b0d439c81a253c","created_at":1756219586,"kind":15555,"tags":[["s","@cosmos"]],"content":"","sig":"87370c99ce1800e5cc4825b9fbb07d261bcc5c23a829779df5cc714ade7279ed2dd414ddbd8cc74568a3689d2107ef8048c6a42bb0256c0bbdcecd29cdcc662d","proof":"01010002d73887c2ec7b95a253081c890ce256fc9eb0159b90bbf00695b043190e5625420100010002e74c891f103b318a9dd5c34b332ff1132497705c6da467cc528a386cb95d5a0c005610032c55258a44b552c64895abb07d8d3c2d81cfc868d7fedb1884b3ee03ab0034010106636f736d6f7301fbd3d400fb9a022251204e6068ae6a082ac3f084e7f026640231e483fff449aaa69707b0d439c81a253c025f9bf4b0f64c05a64cf15fed2cd37ecf49fad8120e4f2e0dac1a4d303a7a438b"}
["EOSE","foo"]

Note that contrary to usual events, the relay will not send newly-published Fabric events, i.e. it doesn’t constantly
retrieve them from Fabric.

Also note that proof field is not considered as a standard part of event, thus, some clients might not be able to process the
event.

The code for the relay can be found here: https://github.com/randomlogin/nostream-spaces

Which event can be anchored to spaces?

Event should be addressable or replaceable (kinds 10001-19999 and 30001-39999).