FEIP7V4_MailOnChain(en-US)



  • FEIP7: MailOnChain
    Version: 4
    Language: en-US
    Author: C_armX, Deisler-JJ_Sboy
    Status: draft
    Created date: 2021-04-03
    Last modified date:2022-04-22
    PID: ""
    TXID: 
    

    FEIP7V4_MailOnChain(en-US)

    Contents

    Metadata

    About FEIP

    About this protocol

    Send

    Delete

    Recover

    Metadata

    Protocol type: FEIP
    Serial number: 7
    Protocol name: MailOnChain
    Version: 4
    Description: Send encrypted mail via the blockchain of FCH.
    Author: C_armX, Deisler-JJ_Sboy
    Language: en-US
    Previous version PID:"0d5f0ecff1f5cd64463bcd08a595e561ded0ea499b2d2e3d5db2d59f950476d8"
    

    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. This protocol helps users to send p2p encrypted mail via the blockchain of FCH.

    2. The sender is the first input address. The recipient is the first output address.

    3. Only the sender of a mail can delete or recover the mail, not the recipient.

    Send

    When user sends a new item, 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: 7 Y
    3 ver int 1 Fixed: 4 Y
    4 name String 13 Fixed: "MailOnChain"<br>Case insensitive N
    5 pid hex 32 Sha256 value of this protocol file N
    6 data.op string 3 fixed:"send" Y
    7 data.alg string 1-32 The encrypt algorithm.<br>"ECC256k1-AES256CBC" is recommended. Y
    8 data.ciphertextSend string 1-1536 mail encrypted with the public key of the sender Y
    9 data.ciphertextReci string 1-1536 mail encrypted with the public key of the recipient Y

    Example for sending a mail

    Sender:
    The address of first input: FEk41Kqjar45fLDriztUDTUkdki7mmcjWK
    Publickey: 6vU3ZMpwggurw92AUy1Vi6WBxEnBPdjupXGKD7Q5Zcw8yvdJAf
    Privatekey: L2bHRej6Fxxipvb4TiR5bu1rkT3tRp8yWEsUy4R1Zb8VMm2x7sd8
    
    Recipient:
    The address of first output: F86zoAvNaQxEuYyvQssV5WxEzapNaiDtTW
    Publickey: 5XEV28ubXGx9Y3sLgQCUvbbE8bJe4tB3xWvY4HanoQeGxmbn3x
    Privatekey: L5DDxf3PkFwi1jArqYokpTsntthLvhDYg44FXyTSgdTx3XEFR1iB
    
    OP_RETURN content:
    
    {
    	"type": "FEIP",
    	"sn": 7,
    	"ver": 4,
    	"name": "MailOnChain",
    	"pid": "",
    	"data": {
    		"op": "send",
    		"alg": "ECC256k1-AES256CBC",
    		"ciphertextSend": "AjTU0rGQvDxhCs3F5x4Pcz3Bsiiry2LryPcKcPIZ2iDsD68U5he9FkM6AVUzEHTjmfBLkhfFu7rv4fveoyMi5YH+wQoiWDxgs/MYjGZBL/Fuq6XZ6IOCXfWyfwphE4uxhEg5TD9ZBRsrJbNxwbdfee5ev5Gvc8kwYROycs0sAG3rNdoJbEZZ7bs2DqvHbAWdG7w4gYLhP9o+C/xVTZHz7Ks9VHb6i04/1at40etlWXxPWSvkdDWxTtyWSSsY2jrbYjfe+ytXQRTRY4gYQdwg+9s=",
    		"ciphertextReci": "AhJkddIcpBMI4FwtDIG1N9JdMkUdcipfHeu9cqsOyepLnET5YersPMHcd4gbZOvBMr60zCii5fWjx7Vv07HaS6KJszeiMtcfTlj/laDdJ+TqK6DWKJ4A1Rpax4WrI2TFbAGoc8rarHOTql2u3wADAdNq+11ALc/kY65alrVfjtKM7KVKBLp3xZgy00YKV9pSo22TLC0+FnWDlUv70ZoAzROKw/z8+BIKz+QipPAwAa7KBgZhlSjryZU6Ad4bydefP11JFh1MS6lkfov0V+LKVCI="
    	}
    }
    

    Delete

    When the sender deletes a mail, 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: 7 Y
    3 ver int 1 Fixed: 4 Y
    4 name String 13 Fixed: "MailOnChain"<br>Case insensitive N
    5 pid hex 32 Sha256 value of this protocol file N
    6 data.op string 3 fixed:"delete" Y
    7 data.sendTxid string 32 The txid in which the mail was sent. Y

    Example for deleting a mail

    {
        "type": "FEIP",
        "sn": 7,
        "ver": 4,
        "name": "MailOnChain",
        "pid": "",
        "data":{
            "op": "delete",
            "sendTxid": "1ee0f015f57e4a70785582109cdc67145474d7bc32de5b47cf262433df5f4661"
        }
    }
    

    Recover

    When the sender recovers a deleted item, 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: 7 Y
    3 ver int 1 Fixed: 4 Y
    4 name String 13 Fixed: "MailOnChain"<br>Case insensitive N
    5 pid hex 32 Sha256 value of this protocol file N
    6 data.op string 3 fixed:"recover" Y
    7 data.sendTxid string 32 The txid in which the mail was sent. Y

    Example for recovering a mail

    {
        "type": "FEIP",
        "sn": 7,
        "ver": 4,
        "name": "MailOnChain",
        "pid": "",
        "data":{
            "op": "recover",
            "sendTxid": "1ee0f015f57e4a70785582109cdc67145474d7bc32de5b47cf262433df5f4661"
        }
    }
    

Log in to reply