FEIP12V3_Contacts(en-US)



  • FEIP12: Contacts
    Version: 3
    Language: en-US
    Author: C_armX
    Status: draft
    Created date: 2021-05-21
    Last modified date:2022-04-22
    PID: ""
    TXID: 
    

    FEIP12V3_Contacts(en-US)

    Contents

    Metadata

    About FEIP

    About this protocol

    Add

    Delete

    Recover


    Metadata

    Protocol type: FEIP
    Serial number: 12
    Protocol name: Contacts
    Version: 3
    Description :  Store contacts encrypted on the FCH blockchain.
    Author: C_armX
    Language: en-US
    Previous version PID:"03a7f8988aac6d6cd3015144667a9ba943e18b58f6a900fa57651fd391d83b9d"
    

    About FEIP

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

    2. The SIGHASH flag of all transaction inputs is ‘ALL’ (value 0x01).

    3. The max size of OP_RETURN : 4096 bytes.

    4. The format of the data in op_return: JSON.

    5. Encoding : utf-8.


    About this protocol

    1. Store your contacts encrypted on the FCH blockchain.

    2. Use the public key of the first output address to encrypt the message.

    3. The contact belongs to the first input address of the transaction that adds it.

    4. Only the address who added the contact can delete or recover it.

    5. When updating an contact, just delete it and add a new one.


    Add

    When user adds a contact, the OP_RETURN contains the data as follows:

    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: 12 Y
    3 ver int 1 Fixed: 3 Y
    4 name String 8 Fixed: "Contacts"<br>Case insensitive N
    5 pid hex 32 Sha256 value of this protocol file N
    6 data.op string 3 operation: "add" Y
    7 data.alg string 1-32 The encrypt algorithm.<br>"ECC256k1-AES256CBC" is recommended. Y
    8 data.ciphertext string 1-2048 Encrypted message Y

    Decrypted data of data.ciphertext

    field number field name type length content required
    1 address string 34 The FCH address of the contact Y
    2 remark string 256 Notes to this contact N

    Example for adding an item

    The address adding or updating a contact: FEk41Kqjar45fLDriztUDTUkdki7mmcjWK
    Publickey: 6vU3ZMpwggurw92AUy1Vi6WBxEnBPdjupXGKD7Q5Zcw8yvdJAf
    Privatekey: L2bHRej6Fxxipvb4TiR5bu1rkT3tRp8yWEsUy4R1Zb8VMm2x7sd8
    
    OP_RETURN content:
    
    {
        "type": "FEIP",
        "sn": 12,
        "ver": 3,
        "name": "Contacts",
        "pid": "",
        "data":{
            "op": "add",
            "alg": "ECC256k1-AES256CBC",
            "ciphertext": "A6JvmsMKSdCpdkFHHOJ7oN7WCo7AyVZJvgsavdFt7Tqb5OvxCtb7M7822xIE6+utanA8HK6qmlUPMW/ZKqKyE+rFP8KPjADShI+/FW7j0sNO6AWBj75xp5kHj5BTrtIC8kiNW8krcgZ/hBUgXkSXnZJgpwsU/CiRhjjHW06DhMDXmQ4kfrQy1yrbrNLDqQcSCXeWzLT8k4+wJVZQSMEf1ysp0ZdwoW5Odh420xqkcV18"
            }
    }
    
    Decrypted data of data.ciphertext:
    
    {
        "address": "F86zoAvNaQxEuYyvQssV5WxEzapNaiDtTW",
        "remark": "A public test address."
    }
    

    Delete

    When user deletes a contact, the OP_RETURN contains the data as follows:

    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: 12 Y
    3 ver int 1 Fixed: 3 Y
    4 name String 8 Fixed: "Contacts"<br>Case insensitive N
    5 pid hex 32 Sha256 value of this protocol file N
    6 data.op string 3 operation: "delete" Y
    7 data.addTxid string 64 The txid in which the contact was added. Y

    Example for deleting an item

    OP_RETURN content:
    
    {
        "type": "FEIP",
        "sn": 12,
        "ver": 3,
        "name": "Contacts",
        "pid": "",
        "data":{
            "op": "delete",
            "addTxid": "5b7929487f79800c9eb41ddf7b192f5730592f58483ba4bef9d0c13921c4f7c3"
            }
    }
    

    Recover

    When user recovers a deleted contact, the OP_RETURN contains the data as follows:

    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: 12 Y
    3 ver int 1 Fixed: 3 Y
    4 name String 8 Fixed: "Contacts"<br>Case insensitive N
    5 pid hex 32 Sha256 value of this protocol file N
    6 data.op string 3 operation: "recover" Y
    7 data.addTxid string 64 The txid in which the contact was added. Y

    Example for recovering an item

    OP_RETURN content:
    
    {
        "type": "FEIP",
        "sn": 12,
        "ver": 3,
        "name": "Contacts",
        "pid": "",
        "data":{
            "op": "recover",
            "addTxid": "5b7929487f79800c9eb41ddf7b192f5730592f58483ba4bef9d0c13921c4f7c3"
            }
    }
    


  • @昌用 呼唤协议的中文翻译组……


Log in to reply