LinkWeave is Linked Data on the Arweave network, connecting the Semantic Web and the Permaweb.
The Semantic Web isn't just about putting data on the web. It is about making links, so that a person or machine can explore the web of data. With linked data, when you have some of it, you can find other, related, data. —Tim Berners-Lee
Arweave offers a robust way of permanently storing data on-chain, beyond the reach of accidental or intentional data loss or manipulation. —Arweave Yellow Paper
LinkWeave adds structured data to Arweave transactions, tags, and documents, linking them together. LinkWeave applies four rules for Linked Data to the Arweave network.
- Name and identify things on Arweave with URIs.
- Use Arweave URIs, which clients can resolve to HTTP URIs.
- Serve information on Arweave using open standards for structured data.
- Link things together on Arweave using their URIs.
LinkWeave uses the ar
scheme to indicate URLs on Arweave:
ar://24UR3q1LfgORZpB8MniVvPtXBUbqGt8yh36SYHKnj3E
These links resolve to the HTTP protocol and an Arweave gateway:
https://arweave.net/24UR3q1LfgORZpB8MniVvPtXBUbqGt8yh36SYHKnj3E
LinkWeave uses JSON-LD as the default data serialization and messaging format:
Content-Type: application/ld+json
LinkWeave uses Schema.org as the recommended vocabulary:
{
"@context": "https://schema.org",
"@type": "VisualArtwork",
"name":"The Two Mysteries",
"description":"Later period symbolic painting",
"dateCreated":"1966",
"creator": {
"@type": "Person",
"name":"René Magritte"
}
}
Applications that represent content usage rights can use Open Digital Rights Language (ODRL).
LinkWeave introduces two tags to Arweave transactions:
Linked-Data
: A JSON string in JSON-LD formatLinked-Data-Src
: The transaction ID of a Linked Data document
Use the Linked-Data
tag to add structured data to an Arweave
transaction.
Tags:
Content-Type: text/plain
Linked-Data: {"@context":"https://schema.org","@type":"DigitalDocument","name":"Hello, World!"}
Data:
# Lorem ipsum dolor sit amet
Deploy a Linked Data document to Arweave.
Tags:
Content-Type: application/ld+json
Data:
{
"@context":"https://schema.org",
"@type":"MediaObject",
"name":"Hello, World!",
"description":"Lorem ipsum dolor sit amet",
"license":"ar://2Dyw2fnOYCU9YphEZwucm--VirNGYMZ-Z5me5dd7KwE"
}
Note: Arweave Deploy and arkb will deploy files with a
.jsonld
file extension as application/ld+json
.
Use the Linked-Data-Src
tag to link an Arweave transaction to a
structured data document. This is useful if the structured data is over
the 2048-byte limit for Arweave tags.
Tags:
Content-Type: image/jpeg
Linked-Data-Src: rIGDfGKo2ARgmOmMBMf0EGJhE39s1AkdDV7xVuEbQg4
Add Linked-Data
or Linked-Data-Src
tags to a SmartWeave contract.
Tags:
Content-Type: image/jpeg
App-Name: SmartWeaveContract
App-Version: 0.3.0
Contract-Src: (SmartWeave Contract Source ID)
Init-State: (JSON String)
Linked-Data: (JSON String)
- Advocate the use of the
ar://
scheme for Arweave URIs. - Host JSON-LD vocabularies on Arweave.
- Draft Linked Data vocabularies specific to Arweave transactions, wallet addresses, etc.
- Host a common set of documents (e.g., free software licenses) on Arweave that can be linked to.
- Develop a JavaScript library for generating LinkWeave tags and documents.
- Augment the Atomic Media Standard, Non-fungible tokens (NFTs), and Profit Sharing Tokens (PSTs) with LinkWeave tags and documents to provide standard metadata for Arweave-based tokens and media objects.
- Provide a mechanism for updating LinkWeave data, analogous to SmartWeave contract state.
We propose a method for representing Linked Data literally in Arweave transaction tags in an extensible way. This has the advantage of making them queryable through GraphQL.
These two sets of tags would be considered equivalent:
Content-Type: text/plain
Linked-Data: {"@context":"https://schema.org","@type":"DigitalDocument","name":"Hello, World!"}
Content-Type: text/plain
Linked-Data-@Context: https://schema.org
Linked-Data-@Type: DigitalDocument
Linked-Data-Name: Hello, World!
The expected types of these extended tags should be one of text, URL, or Arweave transaction ID.
Arweave promises Non-Fungible Tokens (NFTs) where the token balances, metadata, and media files are all on the same network, and even in a single transaction.
LinkWeave can supplement, enhance, and expand Arweave NFTs with Linked Data.
We can measure NFT implementations against Ethereum's Non-Fungible Token Standard (ERC-721).
A complete ERC-721 NFT requires:
- A smart contract (deployed on the Ethereum network)
- A JSON metadata file (hosted off-chain)
- An image file (hosted off-chain)
ERC-721 contracts implement a standard interface, including functions for token balances, transfers, and approvals.
The optional ERC-721 metadata extension adds three read-only functions:
name
: The name of the NFT collectionsymbol
: An abbreviated name for the NFT collectiontokenURI
: The URI for a JSON metadata file for the NFT
The ERC-721 Metadata JSON Schema defines three properties:
name
: The name of the NFT asset (i.e, its title)description
: The description of the NFT assetimage
: The URI for an image file representing the NFT asset
Large NFT marketplaces like OpenSea have added their own metadata standards, which extend the list of properties in the Metadata JSON Schema.
One strategy for making Ethereum NFTs more resilient is hosting the metadata and image files on IPFS or Arweave.
The Arweave community is still in the early stages of developing standards for Non-Fungible Tokens within smart contracts. One common objective is to include both the NFT media file and its metadata in a single transaction. These are called Atomic NFTs.
A minimal implementation of the Atomic NFT concept requires a SmartWeave contract and a media file transaction. This follows the Verto-Compatible NFT Specification, so that the tokens can be listed and traded on an exchange.
The SmartWeave contract handles these functions:
transfer
- Parameters
target
: The address to transfer tokens toqty
: The amount of tokens to transfer
- Returns
state
: A new contract state
- Parameters
balance
- Parameters
target
: The address to get the balance of
- Returns
result
target
ticker
balance
- Parameters
See the SmartWeave contract example token-pst.js.
Compared to ERC-721 NFTs, this Atomic NFT contract lacks a set of "approval" functions to allow third-party operators to manage a wallet's tokens.
The media file transaction has these tags:
Content-Type: (Media Type)
App-Name: SmartWeaveContract
App-Version: 0.3.0
Contract-Src: (SmartWeave Contract Source ID)
Init-State: (JSON String)
The Init-State
has four properties:
name
: The name of the NFT asset (i.e, its title)description
: The description of the NFT assetticker
: An abbreviated name for the NFT collectionbalances
: A mapping of wallet addresses to minted token amounts
The data for the transaction is the media file for the NFT asset. The Atomic Media Standard code can be used to create this transaction.
Implementations of the Atomic NFT concept on Arweave include:
- Verto:
- Follows the Verto contract specification
- Added functions:
mint
- Added properties:
owner
,title
,contentType
,createdAt
,allowMinting
- Note:
title
andname
properties have the same meaning
- Koii:
- Follows the Verto contract specification
- Added properties:
owner
,title
,contentType
,createdAt
,tags
- Note:
name
property means the creator's name
- Pianity
- Uses a similar, extended contract specification
- Uses tags for metadata instead of contract state
These Atomic NFT implementations lack a standard, extensible vocabulary and the ability to link to other resources.
We recommend that any additions to the Atomic NFT contract state should be drawn from Schema.org types such as MediaObject or one of its subtypes. For example:
creator
: The creator/author of the NFTlicense
: A license document for the NFTkeywords
: Keywords or tags describing the NFTencodingFormat
: MIME format of the NFT mediadateCreated
: The date the NFT was created (in ISO 8601 format)
However, it would be preferable to keep the contract state limited to the properties required for listing the NFT on an exchange, and to instead add LinkWeave tags to the transaction in order to include more Linked Data.
If an "Atomic NFT" uses a single transaction, a "Linked NFT" could support expanded NFTs, for example:
- A triptych artwork NFT is a VisualArtwork which links to three media files on Arweave
- A music album NFT is a MusicPlaylist with a track list (each track is a separate audio file on Arweave)
As long as we stick to standard vocabularies and file formats, there are no limits to Linked Data on Arweave.
Copyright (c) 2021 Christopher Adams
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.