FEIP5V2_Service(en-US)



  • FEIP5V2_Service(en-US)

    Contents

    Summary

    General consensus of FEIP

    consensus of this protocol

    Publish a service

    Stop a service

    Recover a service

    Update a service

    Rate a service

    QR code

    Summary

    Protocol type: FEIP
    Serial number: 5
    Protocol name: Service
    Version: 2
    Description :  Publish and manage services on freecash blockchain.
    Author: C_armX, Deisler-JJ_Sboy
    Language: en-US
    Previous version PID:""
    Published date: 2021-11-01
    Last modified date:2023-01-10
    

    General consensus of FEIP type protocols

    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.

    Consensus of this protocol

    1. This protocol is used to publish and manage services on freecash blockchain.

    2. SID(Service Identity): The txid of the transaction in which the service was published.

    3. The publisher can name the service freely. We can take "[stdName]"+"@"+"[cid/address of the publisher]" to refer to the service, such as "FreeDrive@Free_cash".

    4. The publisher should ensure its different services having different stdName.

    5. One can only update, stop, or recover its own published service.

    6. The publisher can't rate its own service.

    7. Stopped or closed services still can be rated.

    8. Owner or Owner's master (see FEIP6_Master) can Close the service and giving a closeStatement.

    9. A closed service can never be operated again.

    Publish a service

    To publish protocol, one can send a tx with the content of op_return as following:

    field number field name type content required
    1 type String Fixed: "FEIP" Y
    2 sn int Serial number<br>Fixed: 5 Y
    3 ver int Fixed: 2 Y
    4 name String Fixed: "Service" N
    5 pid string The PID of this protocol N
    6 data.op string peration: "publish" Y
    7 data.stdName string the name of the service in english Y
    8 data.localName string array service names in different languages N
    9 data.desc string Description of this service N
    10 data.types string array The types of the service N
    11 data.urls string array URLs describing the service N
    12 data.pubKeyAdmin hex The public key of the FCH identity designated by the publisher for this service N
    13 data.protocols string array The protocols followed by this service N
    14 data.params structure Parameters customized by the service provider. N

    Example of publishing a service

    {
    	"type": "FEIP",
    	"sn": 5,
    	"ver": 2,
    	"name": "Service",
    	"pid": "",
    	"data": {
    		"op": "publish",
    		"stdName": "freedrive",
    		"localName": ["飞盘", "フリスビー"],
    		"desc": "Free and open cloud storage service",
    		"types": ["cloud storage", "infrastructure"],
    		"urls": ["https://freedrive.com"],
    		"pubKeyAdmin": "02966dc682850550b1df046f2a03cfe546c4e4cf83f739d1497f6c292fabdad1b4",
    		"protocols": ["b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553", "37406e3e45750efccdb060ca2e748f9f026aebb7dadade8e8747340f380edaca"],
    		"params": {
    			"urlHead": "http://sign.cash/api/",
    			"currency": "fch",
    			"account": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    			"pricePerRequest": "0.001",
    			"minPayment": "10"
    		}
    	}
    }
    

    Stop a service

    The publisher of the protocol sends a tx with the content of op_return as following:

    field number field name type content required
    1 type String Fixed: "FEIP" Y
    2 sn int Serial number<br>Fixed: 28 Y
    3 ver int Fixed: 2 Y
    4 name String Fixed: "Service" N
    5 pid string The PID of this protocol N
    6 data.sid hex Txid when publishing the service Y
    7 data.op string operation: "stop" Y

    Example of stopping a service

    {
        "type": "FEIP",
        "sn": 5,
        "ver": 2,
        "name": "Service",
        "pid": "",
        "data":{
            "sid": "a246f36574f039460063f626f023c2e13a4d184c89279795539be220e9402643",
            "op": "stop"
        }
    }
    

    Recover a service

    The publisher of the protocol send a tx with the content of op_return as following:

    field number field name type content required
    1 type String Fixed: "FEIP" Y
    2 sn int Serial number<br>Fixed: 28 Y
    3 ver int Fixed: 2 Y
    4 name String Fixed: "Service" N
    5 pid string The PID of this protocol N
    6 data.sid hex Txid when publishing the service Y
    7 data.op string operation: "recover" Y

    Example of recovering a Service

    {
        "type": "FEIP",
        "sn": 5,
        "ver": 2,
        "name": "Service",
        "pid": "",
        "data":{
            "sid": "a246f36574f039460063f626f023c2e13a4d184c89279795539be220e9402643",
            "op": "recover"
        }
    }
    

    Update a service

    The publisher of the protocol sends a tx with the content of op_return as following:

    field number field name type content required
    1 type String Fixed: "FEIP" Y
    2 sn int Serial number<br>Fixed: 5 Y
    3 ver int Fixed: 2 Y
    4 name String Fixed: "Service" N
    5 pid string The PID of this protocol N
    6 data.sid hex Txid when publishing the service Y
    7 data.op string operation: "update" Y
    8 data.stdName string the name of the service in english Y
    9 data.localName string array service names in different languages N
    10 data.desc string Description of this service N
    11 data.types string array The types of the service N
    12 data.urls string array URLs describing the service N
    13 data.pubKeyAdmin hex The public key of the FCH identity designated by the publisher for this service N
    14 data.protocols string array The protocols followed by this service N
    15 data.params structure Parameters customized by the service provider. N

    Example of updating a Service

    {
        "type": "FEIP",
        "sn": 5,
        "ver": 2,
        "name": "Service",
        "pid": "",
        "data":{
            "sid": "a246f36574f039460063f626f023c2e13a4d184c89279795539be220e9402643",
            "op": "update",
            "stdName": "freedrive#1",
    		"localName": ["飞盘#1","フリスビー#1"],
                    "desc": "Free and open cloud storage service",
    		"types": ["cloud storage","infrastructure"],
    		"urls": ["https://freedrive.com"],
    		"pubKeyAdmin": "02966dc682850550b1df046f2a03cfe546c4e4cf83f739d1497f6c292fabdad1b4",
    		"protocols": ["b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553", "37406e3e45750efccdb060ca2e748f9f026aebb7dadade8e8747340f380edaca"],
    		"params": {
    			"urlHead": "http://sign.cash/api/",
    			"currency": "fch",
    			"account": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    			"pricePerRequest": "0.001",
    			"minPayment": "10"
    		}
        }
    }
    

    Rate a service

    Anyone but the publisher of the protocol sends a tx with the content of op_return as following:

    field number field name type content required
    1 type String Fixed: "FEIP" Y
    2 sn int Serial number<br>Fixed: 28 Y
    3 ver int Fixed: 2 Y
    4 name String Fixed: "Service" N
    5 pid string The PID of this protocol N
    6 data.sid hex Txid when publishing the service Y
    7 data.op string operation: "rate" Y
    8 data.rate int Score of rating from 0 to 5 Y

    Example of Rating a Service

    {
        "type": "FEIP",
        "sn": 5,
        "ver": 2,
        "name": "Service",
        "pid": "",
        "data":{
            "sid": "a246f36574f039460063f626f023c2e13a4d184c89279795539be220e9402643",
            "op": "rate",
            "rate": 4
        }
    }
    

    QR code

    The QR code of a published service has fields as following:

    {
        "meta": "FC",
        "type": "FEIP",
        "sn": 5,
        "ver": 2,
        "data":{
            "sid":"a246f36574f039460063f626f023c2e13a4d184c89279795539be220e9402643"
        }
    }
    

Log in to reply