Developer Hub
Relation ProtocolRelation ONE APIRelation Graph API
English
English
  • Overview
  • QUICK START
    • Deploy a Semantic SBT contract leveraging Relation Protocol
    • Deploying query services using Graph Indexer
  • KEY CONCEPTS
    • RDF
    • Semantic SBTs
    • Social Graph
  • Architecture
  • Schema Standard
    • Overview
    • How schemas limit smart contracts
    • Store schema
    • List of schemas
  • Contract Open Standard
    • Overview
    • Identity
      • Name Service
    • Relationship
      • Follow
      • Dao
    • Publication
      • Content
      • Privacy Content
  • Open Standard API
    • Introduction
    • EIP-6239
    • Business Interface
      • Identity
      • Relationship
      • Publication
  • Graph Indexer
    • Definition and usage
    • Listen to events
    • To parse RDF data
    • To build a social graph
  • Integrations
    • Quick start
    • Construct a social graph with Relation Protocol
    • List of resources
    • NameService contract guide
    • Follow contract guide
    • Dao contract guide
    • Content contract guide
    • PrivacyContent contract guide
  • Relation Name Service
    • Name Service Api
  • Use Case
  • APPENDIX
    • Deploy a contract using Hardhat
    • SemanticSBT Deployment tool
Powered by GitBook
On this page
  • Content
  • PrivacyContent
  1. Open Standard API
  2. Business Interface

Publication

Content

  1. Publish content

  function post(string memory content) external;

The prepared tokenId and the transaction hash on Arweave for the content to be published will be used to generate a SBT, with the actual content stored on Arweave. The transaction hash on Arweave is stored on the bloclchain as the content.

Parameters:

  • content: The transaction hash on Arweave relating to the content. One can access the original content via this hash.

The content uploaded to Arweave is structured as follows:

{
  "content": {
    "body": "${The body of content}",
    "title": "${The title of content}"
  }
}
  1. Lookup published content

  function contentOf(uint256 tokenId) external view returns (string memory content);

Lookup published content using tokenId:

Parameters:

  • tokenId

Return value:

  • content: The transaction hash on Arweave relating to the content. One can access the original content via this hash.

PrivacyContent

  1. Prepare a tokenId

  function prepareToken() external returns (uint256);

The user is preparing a tokenId.

Return value:

  • tokenId: The prepared tokenId

  1. Lookup the tokenId prepared.

  function ownedPrepareToken(address owner) external view returns (uint256);

Parameters:

  • owner: The address to be looked up

Return value:

  • tokenId: The prepared tokenId

  1. Publish privacy content

  function post(uint256 tokenId, string memory content) external;

The prepared tokenId and the transaction hash on Arweave for the content to be published will be used to generate a SBT, with the actual privacy content and its permissions stored on Arweave. The transaction hash on Arweave is stored on the blockchain as the content.

Parameters:

  • tokenId: The tokenId prepared.

  • content: The transaction hash on Arweave relating to the privacy content and its permissions. The hash can be used to access the original content.

The content uploaded to Arweave is structured as follows:

{
  "encryptionBy": "lit-protocol",
  "accessCondition": [
    {
      "contractAddress": "${The contract address of Semantic SBT}",
      "standardContractType": "ERC721",
      "chain": "polygon",
      "method": "isViewerOf",
      "parameters": [
        ":userAddress",
        "${The tokenId}"
      ],
      "returnValueTest": {
        "comparator": "=",
        "value": true
      }
    }
  ],
  "encryptedSymmetricKey": "${A hex string that LIT will use to decrypt your content as long as you satisfy the conditions}",
  // encrypted content
  "encryptedObject": "${The encrypted content}"
}
  1. Viewer permission

  function isViewerOf(address viewer, uint256 tokenId) external view returns (bool);

To check if a given address has access to the privacy content related to a tokenId.

Parameters:

  • viewer: The view's address

  • tokenId

Return value:

  • isViewer: true--has viewer permission; false--do not have viewer permission

  1. Lookup published content

  function contentOf(uint256 tokenId) external view returns (string memory content);

Lookup published content according to tokenId.

parameters:

  • tokenId

Return value:

  • content: The Arweave transaction value related to the published content. One can access the original content using this hash.

Last updated 2 years ago