FEIP31V1_OpenKnowledge(en-US)



  • FEIP31: OpenKnowledge
    Version: 1
    Language: en-US
    Author: C_armX, master_wang
    Status: draft
    Created date: 2021-06-04
    Last modified date:2021-06-04
    File hash: ""
    TXid: 
    

    FEIP31V1_OpenKnowledge(en-US)

    Contents

    Introduction

    General consensus of FEIP type protocols

    Consensus specific to this protocol

    Process

    知识文件

    知识发布

    知识删除

    知识评价

    Introduction

    Protocol type: FEIP
    Serial number: 31
    Protocol name: OpenKnowledge
    Version: 1
    Description : Publish open knowledge publicly.
    Author: C_armX, master_wang
    Language: en-US
    Tags: FEIP, Knowledge, open, application protocol
    Previous version hash:""
    

    General consensus of FEIP type protocols

    1. Write important data in OP_RETURN for public witness under FEIP type protocols

    2. The max size of OP_RETURN : 4096 bytes

    3. Format : compacted json

    4. Encoding : utf-8

    Consensus specific to this protocol

    1. 本协议发布未经加密的开放知识;
    2. 所发布知识的内容存放于freedrive,索引存放于fch主链;
    3. 本协议仅实现开放知识的公开发布,不包含用户的相关文件管理;
    4. 发布在主链的知识只有原上链地址标注的删除为有效删除。

    Process

    1. 用户撰写编辑知识:用户在应用内制作知识。
    2. 用户本地管理知识:应用按照自己的逻辑为用户管理知识。
    3. 用户发布知识:1)用户授权应用按知识文件内容格式制作知识文件,2)应用将知识文件存放于freedrive系统;3)用户签名将知识概要按照知识上链内容格式在FCH主链上公布。
    4. 用户更新知识:与用户发布知识步骤相同,在上链内容的data.preVerHash字段填入上一版本哈希,在data.srcHash字段填入第一个版本哈希。
    5. 用户删除知识:发送链上交易”data.op“字段值为”del“,引用要删除的知识的fid标注删除。
    6. 读者阅读评价知识:读者消耗币天引用知识哈希评价知识。
    7. 知识平台检索过滤知识,公开展示或推送给订阅用户。
    8. 应用和平台将用户数据文件存储于freedrive的逻辑和格式由HAT协议和freedrive协议约定。

    知识文件

    知识保存文件的内容按照以下格式:

    1. "FC":string,2字节,标注本文件为自由共识生态文件。
    2. 知识描述json(见下表)
    3. 知识内容
    4. 文件结束标志:EOF
    序号 字段名 中文名 类型 值的说明 长度
    1 type 协议类型 String Fixed: "FEIP"<br>Case insensitive 4
    2 sn 协议编号 int Serial number<br>Fixed: 31 2
    3 ver 协议版本 int Fixed: 1 1
    4 name 协议名称 String Fixed: "openKnowledge"<br>Case insensitive 0~13
    5 data.title 标题 string 知识的标题 0~256
    6 data.type 类型 string protocol, article,wiki,news,event,应用自定义 0~32
    7 data.authors 作者 string array 用户自定义 0~1024
    8 data.souce 来源 string "original"或来源url 0~4096
    9 data.abstrict 摘要 string 用户自定义 0~1024

    Example

    FC
    {
        "type": "FEIP",
        "sn": 31,
        "ver": 1,
        "name": "OpenKnowledge",
        "hash": "",
        "data":{
            "title": "Bitcoin: A Peer-to-Peer Electronic Cash System",
            "type": "article",
            "authors": ["1Satoshi Nakamoto"],
            "souce":"https://bitcoin.org/bitcoin.pdf",
            "abstrict": "A purely peer-to-peer version of electronic cash would allow online payments to be sent directly from one party to another without going through a financial institution. ..."       
        }
    }
    Example content: Introduction  Commerce on the Internet has come to rely almost exclusively on financial institutions serving as trusted third parties to process electronic payments. While the system works well enough for most transactions, it still suffers from the inherent weaknesses of the trust based model. Completely non-reversible transactions are not really possible, since financial institutions cannot avoid mediating disputes. The cost of mediation increases transaction costs, limiting the minimum practical transaction size and cutting off the possibility for small casual transactions, and there is a broader cost in the loss of ability to make non-reversible payments for non- reversible services. ...
    EOF
    

    知识发布

    知识链上发布按照以下格式填写op_return:

    field number field name type length content required
    1 type String 4 Fixed: "FEIP"<br>Case insensitive Y
    2 sn int 2 Serial number<br>Fixed: 31 Y
    3 ver int 1 Fixed: 1 Y
    4 name String 13 Fixed: "OpenKnowledge"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.fid string 32 文件身份,文件的Sha256值 Y
    1 data.title 标题 string 知识的标题 0~256
    2 data.type 类型 string protocol, article,wiki,news,event,应用自定义 0~32
    7 data.authors 作者 string array 用户自定义 0~1024
    7 data.srcHash string 0~32 源哈希,Sha256 N
    8 data.preVerHash string 0~32 前版哈希,Sha256 N
    10 data.loca string array 0~2048 存放位置,url N
    11 data.app string 0~32 the name, cid or address of the app N

    Example of publishing an item

    {
        "type": "FEIP",
        "sn": 31,
        "ver": 1,
        "name": "OpenKnowledge",
        "hash": "",
        "data":{
            "fid": "b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553",
            "title": "Bitcoin: A Peer-to-Peer Electronic Cash System",
            "type": "article",
            "authors": ["1Satoshi Nakamoto"],
            "srcHash": "",
            "preVerHash": "",
            "loca":["https://bitcoin.org/bitcoin.pdf"],
            "app":"write_cash"
        }
    }
    

    删除知识

    发布者可以对自己发布的知识标注删除,按以下格式填写op_return:

    op_return内容为:

    field number field name type length content required
    1 type String 4 Fixed: "FEIP"<br>Case insensitive Y
    2 sn int 2 Serial number<br>Fixed: 31 Y
    3 ver int 1 Fixed: 1 Y
    4 name String 4 Fixed: "OpenKnowledge"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.op string 3 operation: "del" Y
    7 data.fid string 32 要删除的知识文件的Sha256值 Y

    Example of deleting an item

    {
        "type": "FEIP",
        "sn": 31,
        "ver": 1,
        "name": "OpenKnowledge",
        "hash": "",
        "data":{
            "op": "del",
            "fid": "b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553"
        }
    }
    

    知识评价

    读者发送一笔交易。op_return内容为:

    field number field name type length content required
    1 type String 4 Fixed: "FEIP"<br>Case insensitive Y
    2 sn int 2 Serial number<br>Fixed: 31 Y
    3 ver int 1 Fixed: 1 Y
    4 name String 4 Fixed: "OpenKnowledge"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.op string 4 operation: "rate" Y
    7 data.fid string 32 要删除的知识文件的Sha256值 Y
    8 data.rate int 1 Rating of the item from 1 to 5 N

    Example of rating an item

    {
        "type": "FEIP",
        "sn": 31,
        "ver": 1,
        "name": "OpenKnowledge",
        "hash": "",
        "data":{
            "op": "rate"
            "fid": "b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553",
            "rate": 4
        }
    }
    


  • @昌用 这回把存储和发布、使用、检索分开来,逻辑更清晰、简洁,实现更容易了。赞👍


Log in to reply