FEIP5V2_Service(en-US)
-
FEIP5V2_Service(en-US)
Contents
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
-
Write important data in OP_RETURN for public witness under FEIP type protocols.
-
The SIGHASH flag of all transaction inputs is ‘ALL’ (value 0x01).
-
The max size of OP_RETURN : 4096 bytes.
-
The format of the data in op_return: JSON.
-
Encoding : utf-8.
Consensus of this protocol
-
This protocol is used to publish and manage services on freecash blockchain.
-
SID(Service Identity): The txid of the transaction in which the service was published.
-
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".
-
The publisher should ensure its different services having different stdName.
-
One can only update, stop, or recover its own published service.
-
The publisher can't rate its own service.
-
Stopped or closed services still can be rated.
-
Owner or Owner's master (see FEIP6_Master) can Close the service and giving a
closeStatement
. -
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" } }
-