> For the complete documentation index, see [llms.txt](https://relationlabs.gitbook.io/protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://relationlabs.gitbook.io/protocol/protocol-zh/open-standard-api/overview/publication.md).

# Publication

## Content

1. 发布内容

```solidity
  function post(string memory content) external;
```

提供预生成的tokenId和待发布内容的Arweave哈希，生成一个SBT。实际内容存放在Arweave上，将Arweave交易哈希作为内容记录在链上

参数：

* content: 发布的内容对应的Arweave交易哈希，可通过此交易哈希访问到原始发布内容

上传至Arweave的内容格式如下：

```json
{
  "content": {
    "body": "${The body of content}",
    "title": "${The title of content}"
  }
}
```

4. 查询发布内容

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

根据tokenId查询关联的发布内容

参数：

* tokenId

返回：

* content: 发布的内容对应的Arweave交易哈希，可通过此交易哈希访问到原始发布内容

## PrivacyContent

1. 预生成tokenId

```solidity
  function prepareToken() external returns (uint256);
```

用户预生成一个tokenId

返回：

* tokenId: 预生成的tokenId

2. 查询持有的预生成tokenId

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

参数：

* owner: 被查询的地址

返回：

* tokenId： 预生成的tokenId

3. 发布隐私内容

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

提供预生成的tokenId和待发布内容的Arweave哈希，生成一个SBT。实际隐私内容以及许可条件存放在Arweave上，将Arweave交易哈希作为内容记录在链上

参数：

* tokenId： 预生成的tokenId
* content: 隐私内容以及许可条件对应的Arweave交易哈希，可通过此交易哈希访问到原始发布内容

上传至Arweave的内容格式如下：

```json
{
  "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}"
}

```

4. 是否具备查看权限

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

查询某个地址是否具备tokenId对应的隐私数据的查看权限。

参数：

* viewer： 查看者的地址
* tokenId

返回：

* isViewer: true--具备查看权限；false--不具备查看权限

5. 查询发布内容

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

根据tokenId查询关联的发布内容

参数：

* tokenId

返回：

* content: 发布的内容对应的Arweave交易哈希，可通过此交易哈希访问到原始发布内容
