Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft #1

Open
airyland opened this issue Oct 26, 2022 · 0 comments
Open

draft #1

airyland opened this issue Oct 26, 2022 · 0 comments

Comments

@airyland
Copy link
Member

airyland commented Oct 26, 2022

概述

目前 ECHO 官方节点上链使用地址为:1ua8SSKVqIHAu4xEBPPRw13z7Jwj8mOetx17kreecho

后续允许用户或者组织使用自己钱包按照 ECHO 定义的数据结构将数据上链,同时其他节点会索引到自己的数据库中。

[ ] 由于在开发 JS SDK 中,还未完成直接从 Arweave 爬块将数据直接索引到数据库的工作。

everPay 开发了一个块数据同步工具:https://github.com/everFinance/arsyncer

数据示例

ECHO 数据使用 Arseeding 上链到 Arweave,一个示例如下:

https://v2.viewblock.io/arweave/tx/Z7BG_EyJ_U58NoZ30sGdNcX9_vDleG4Xk9wQSCX_M5M

tags:

{
  'Content-Type': 'application/json',
  'Network': 'EVAR',
  'V': '0.1',
  'App-Name': 'ECHO',
  'Type': 'comment',
  'Target-Uri': 'https://mirror.xyz/dashboard/edit/j97jajqguWyn-I9QoGqI6oj6UcxUm16ISgo2QhYhXM8',
  'Author': 'EVM/0xC9730958c865527CF4D93E1C681A0a0ba62a43D6'
}
  • Network 数据网络。固定为 EVAR,是 ECHO 及相关产品定义的一个数据网络的名字
  • V 协议版本号。目前为 0.1
  • App-Name 应用名称。所有 ECHO 评论使用 ECHO
  • Type 内容类型。ECHO 内容类型有 comment, reaction, tip(其中 tip 数据还未上链)
  • Sub-Type 细分类型。只有 reaction 有细分类型,like/dislike 操作时 SubType 分别对应 like/dislike
  • Author 发布者钱包地址。EVM 地址会带上 EVM/ 前缀。solana 地址是 solana/ 前缀。

在 Arweave 中使用 Network: EVAR + App-Name: ECHO 可以检索和 ECHO 相关的数据。

data:

{
  "content": {
    "id": "62325d6a-f0c6-42ad-8a77-f2fa7398c54b",
    "body": "试一试新的评论点赞功能",
    "timestamp": 1665953506934
  },
  "authorship": {
    "cSignature": "2101f13ea84388befe84881cee5e8d61f845f398c90e98182c92ac06233c002d6ea5b3c93714aa9b3aae28fa0c5b641510893be7a297d19859ebd78248c152ec",
    "sMessage": "I authorize publishing on ECHO from this device with my account: EVM/0xc9730958c865527cf4d93e1c681a0a0ba62a43d6\n\nI accept the Terms of Service: https://0xecho.com/tos\n\nIssued At: 1665953492345\nPublic Key: 0236819a2da8120893ac0695479e6ace5b8aab7904cd35fdd389c81e7514cfbbc8",
    "sSignature": "e2ecf8ef4df8a38487b224da2c319351b797ff019caf58fbcc646f886535cc4b488056b01ab6b1a7c598ed643e95a7b7ae7fd39681851f2d278590f383abeb751c"
  }
}
  • content.id 内容 uuid v4。由 ECHO 的前端页面直接生成。

  • content.body 评论内容。如果是 like/dislike 等 reaction 操作,此项为空。

  • content.timestamp 评论日期。索引数据时以该时间作为具体的内容发布时间,因为会有延时上链的情况。

  • authorship.cSignature 内容签名。由用户登录后生成仅保存在前端的私钥对数据进行签名。具体签名方式需要在后续的 JS SDK 中查阅。

  • authorship.sMessage 签名内容。用户登录时签名的内容,签名中包含了本地生成的 public key。

  • authorship.sSignature 用户钱包对上述内容的签名。

评论对象的 Metadata

目前 ECHO 应用本身不抓取或者保存相应页面的 title, desc, favicon 等信息。后续可能会进行抓取和缓存。

target uri schema

Mirror 早期我们支持使用 https 地址作为 target_uri,但考虑到地址会因为用户 ens 发生变化而变化,因此在后续我们修改为 dapp/mirror/{{ori_content_digest}} 的形式。

对于 NFT 使用 slip-0044 coin type 区分不同链 https://github.com/satoshilabs/slips/blob/master/slip-0044.md
比如 eth 的 coin type 为 60

  • https:// http url

  • dweb/ipfs/{{CID}}

  • dweb/ipns/{{CID}} Planet 嵌入使用的格式

  • dapp/mirror/{{ori_content_digest}}

  • dapp/voice/{{id}}

  • nft/{{slip-0044 coin type}}/{{contract_address}}/{{token_id}}

  • contract/{{slip-0044 coin type}}/{{contract_address}}

  • address/{{slip-0044 coin type}}/{{address}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant