FEIP12V3_Contacts(en-US)



  • FEIP12: Contacts
    Version: 3
    Language: en-US
    Author: C_armX
    Status: draft
    Created date: 2021-05-21
    Last modified date:2021-05-21
    File hash: ""
    TXid: 
    

    FEIP12V3_Contacts(en-US)

    Contents

    Introduction

    General rules of FEIP type protocols

    Rules specific to this protocol

    Add or update a Contact

    Delete a Contact

    Introduction

    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
    Tags: FEIP, contacts, application protocol
    Previous version hash:"03a7f8988aac6d6cd3015144667a9ba943e18b58f6a900fa57651fd391d83b9d"
    

    General rules 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

    Rules specific to 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. When an address is added or deleted multiple times, the latest one shall prevail.

    Add or update a contact

    When user add or update 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 hash hex 32 Sha256 value of this protocol file N
    6 data.alg string 1-32 The encrypt algorithm.<br>"ECC256k1-AES256CBC" is recommended. Y
    7 data.info string 1-2048 Encrypted message Y

    Unencrypted data of data.info

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

    Example to add 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",
        "hash": "",
        "data":{
            "alg": "ECC256k1-AES256CBC",
            "info": "A6JvmsMKSdCpdkFHHOJ7oN7WCo7AyVZJvgsavdFt7Tqb5OvxCtb7M7822xIE6+utanA8HK6qmlUPMW/ZKqKyE+rFP8KPjADShI+/FW7j0sNO6AWBj75xp5kHj5BTrtIC8kiNW8krcgZ/hBUgXkSXnZJgpwsU/CiRhjjHW06DhMDXmQ4kfrQy1yrbrNLDqQcSCXeWzLT8k4+wJVZQSMEf1ysp0ZdwoW5Odh420xqkcV18"
            }
    }
    
    Unencrypted data of data.info:
    
    {
        "op": "add",
        "address": "F86zoAvNaQxEuYyvQssV5WxEzapNaiDtTW",
        "remark": "A public test address."
    }
    

    Delete a contact

    When user delete 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 hash hex 32 Sha256 value of this protocol file N
    6 data.alg string 1-32 The encrypt algorithm.<br>"ECC256k1-AES256CBC" is recommended. Y
    7 data.info string 1-2048 Encrypted message Y

    Unencrypted data of data.info

    field number field name type length content required
    1 op string 3 operation: "del" Y
    2 address string 34 The FCH address of the contact Y

    Example to del an item

    The address deleting a contact: FEk41Kqjar45fLDriztUDTUkdki7mmcjWK
    Publickey: 6vU3ZMpwggurw92AUy1Vi6WBxEnBPdjupXGKD7Q5Zcw8yvdJAf
    Privatekey: L2bHRej6Fxxipvb4TiR5bu1rkT3tRp8yWEsUy4R1Zb8VMm2x7sd8
    
    OP_RETURN content:
    
    {
        "type": "FEIP",
        "sn": 12,
        "ver": 3,
        "name": "Contacts",
        "hash": "",
        "data":{
            "alg": "ECC256k1-AES256CBC",
            "info": "AiiD4nPCvNNctWWy0VwezIkKmv8SnyMyOaPGdD8ZWtT4zvy9EbweaLDzateEwSFostLCCBHvJEmPeOPl6Y7DhzRUQBxTA7TVXOGedRlJkXO/JqyH6Ith3yCjrJpQEC1JPrgQZFp9UAAzMoD4WDl+UIERKdrlGXewFFLdCK6ZlxEWjU1RyDnZjFUzsPu94KPwIQ=="
            }
    }
    
    Unencrypted data of data.info:
    
    {
        "op": "del",
        "address": "F86zoAvNaQxEuYyvQssV5WxEzapNaiDtTW",
    }
    


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


Log in to reply