Group Details Private

administrators

  • RE: APIP2V1_BasicInfoOnChain(zh-CN)

    5. 交易列表接口

    名称

    txList

    说明

    按条件获取某个地址的历史交易信息列表。

    请求参数

    name type description required
    address string FCH address Y
    filterOpReturn string Filter by opReturn N
    filterCdd string Filter by cdd N
    filterChangeUnconfirmed string Filter by changeUnconfirmed, "-0", "0" or "0-". N
    sortTxTimestamp string Sort by txTimestamp N
    sortCdd string Sort by cdd N
    sortAmount string Sort by amount N
    count int How many entries the requester wants at a time. N
    sequence int The sequence of requests N
    • 示例

    按照交易时间从近到远,请求地址FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts的第2批20条(即第21-40条)OP_RETURN非空,且币天销毁大于等于100的交易信息。

    参数

    {
    	"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    	"count": "20",
    	"sequence": 2,
    	"filterOpReturn": "notNull",
    	"filterCdd": "100,100-",
    	"sortTxTimestamp": "down",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/txList?address=FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts&count=20&filterCdd=100,100-&filterOpReturn=notNull&sequence=2&sortTxTimestamp=down&timestamp=1635513688254
    
    - sign = sha256(sha256(https://www.sign.cash/api/txList?address=FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts&count=20&filterCdd=100,100-&filterOpReturn=notNull&sequence=2&sortTxTimestamp=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/txList?address=FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts&count=20&filterCdd=100,100-&filterOpReturn=notNull&sequence=2&sortTxTimestamp=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=111111111111111000000000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/txList
    
    - unsignedRequest:
    
    {"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","count":"20","filterCdd":"100,100-","filterOpReturn":"notNull","sequence":2,"sortTxTimestamp":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/txList"}
    
    - sign = sha256(sha256({"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","count":"20","filterCdd":"100,100-","filterOpReturn":"notNull","sequence":2,"sortTxTimestamp":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/txList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111000000000000000000
    
    - signedRequest:
    
    {"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","count":"20","filterCdd":"100,100-","filterOpReturn":"notNull","sequence":2,"sortTxTimestamp":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/txList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111000000000000000000"}
    

    响应参数

    name type description
    txList object See below
    height uint The latest block height when getting the data.
    • txList
    name type description
    txTimestamp The time stamp of this transaction
    fee uint64 Transaction fee in unit of satoshi
    cdd uint64 The coindays destroyed in this transaction
    opReturn string message in OP_RETURN
    amount uint64 total amount spent
    block uint The height of the block where this transaction was written.
    input object The list of input. See below
    output object The list of output. See below
    • input
    name type description
    index uint The sequence in the input list,counting from 0.
    address string
    amount uint64 In unit of satoshi
    • output
    name type description
    index uint The sequence in the output list,counting from 0.
    address string
    amount uint64 In unit of satoshi
    • 示例
    {
    	"txList": [{
    			"txTimestamp": 1636180054032,
    			"fee": 2431,
    			"cdd": 3600,
    			"opReturn": "test in",
    			"amout": "210000000",
    			"block": 963220,
    			"input": [{
    					"index": 0,
    					"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    					"amount": 10000000
    				},
    				{
    					"index": 1,
    					"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    					"amount": 200000000
    				}
    			],
    			"output": [{
    					"index": 0,
    					"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    					"amount": 10000000
    				},
    				{
    					"index": 1,
    					"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    					"amount": 199997569
    				}
    			]
    		},
    
    		{
    			"txTimestamp": 1636180054239,
    			"fee": 531,
    			"cdd": 230,
    			"opReturn": "hi",
    			"amout": "110000000",
    			"block": 963233,
    			"input": [{
    					"index": 0,
    					"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    					"amount": 10000000
    				},
    				{
    					"index": 1,
    					"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    					"amount": 100000000
    				}
    			],
    			"output": [{
    					"index": 0,
    					"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    					"amount": 10000000
    				},
    				{
    					"index": 1,
    					"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    					"amount": 99999469
    				}
    			]
    		}
    	],
    	"heignt": 963667
    }
    排序、压缩、签名后:
    
    {"heignt":963667,"txList":[{"amout":"210000000","block":963220,"cdd":3600,"fee":2431,"input":[{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","amount":10000000,"index":0},{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","amount":200000000,"index":1}],"opReturn":"test in","output":[{"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","amount":10000000,"index":0},{"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","amount":199997569,"index":1}],"txTimestamp":"1636180054032"},{"amout":"110000000","block":963233,"cdd":230,"fee":531,"input":[{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","amount":10000000,"index":0},{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","amount":100000000,"index":1}],"opReturn":"hi","output":[{"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","amount":10000000,"index":0},{"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","amount":99999469,"index":1}],"txTimestamp":"1636180054239"}],"sign":""111111111111111000000000""}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    2000 The address has not been used. 地址从未被使用 address
    2001 There is no UTXO at this address. 该地址没有utxo address
    2007 No more transactions. 没有更多的交易了。 address,count,sequence
    • 示例
    {
        "code":2007,
        "msg":"No more transactions.",
        "data":{
            "address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
            "count":20,
            "sequence":2
        }
    }
    

    6. 未确认交易接口

    名称

    txUnconfirmed

    说明

    获取某个地址的未确认交易列表。

    请求参数

    name type description
    address string 34
    • 示例

    查询FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts的未确认交易列表。

    参数

    {
    	"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/txUnconfirmed?address=FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts&timestamp=1635513688254
    
    - sign = sha256(sha256(https://www.sign.cash/api/txUnconfirmed?address=FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/txUnconfirmed?address=FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/txUnconfirmed
    
    - unsignedRequest:
    
    {"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","timestamp":1635513688254,"url":"https://www.sign.cash/api/txUnconfirmed"}
    
    - sign = sha256(sha256({"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","timestamp":1635513688254,"url":"https://www.sign.cash/api/txUnconfirmed","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=baafb3229491f81ecb48a93b25575aea981c58d074408ae8bf2db592be5c8d6a
    
    - signedRequest:
    
    {"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","timestamp":1635513688254,"url":"https://www.sign.cash/api/txUnconfirmed","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"111111111111111000000000"}
    

    响应参数

    name type description
    unconfirmedTxList object The list of the unconfirmed transactions. See below
    height uint The latest block height when getting the data.
    • unconfirmedTxList
    name type description
    txTimestamp time stamp
    fee uint64 Transaction fee in unit of satoshi
    opReturn string message in OP_RETURN
    amount uint64 total amount spent
    input object The list of input. See below
    output object The list of output. See below
    • input
    name type description
    index uint The sequence in the input list,counting from 0.
    address string
    amount uint64 In unit of satoshi
    • output
    name type description
    index uint The sequence in the output list,counting from 0.
    address string
    amount uint64 In unit of satoshi
    • 示例
    {
        "unconfirmedTxList":
    [{
    			"txTimestamp": 1636180054032,
    			"fee": 2431,
    			"opReturn": "test in",
    			"amout": "210000000",
    			"input": [{
    					"index": 0,
    					"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    					"amount": 10000000
    				},
    				{
    					"index": 1,
    					"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    					"amount": 200000000
    				}
    			],
    			"output": [{
    					"index": 0,
    					"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    					"amount": 10000000
    				},
    				{
    					"index": 1,
    					"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    					"amount": 199997569
    				}
    			]
    		},
    
    		{
    			"txTimestamp": 1636180054239,
    			"fee": 531,
    			"opReturn": "hi",
    			"amout": "110000000",
    			"input": [{
    					"index": 0,
    					"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    					"amount": 10000000
    				},
    				{
    					"index": 1,
    					"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    					"amount": 100000000
    				}
    			],
    			"output": [{
    					"index": 0,
    					"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    					"amount": 10000000
    				},
    				{
    					"index": 1,
    					"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    					"amount": 99999469
    				}
    			]
    		}
    	],
        "heignt": 963667
    }
    

    排序、压缩、签名后:

    {"heignt":963667,"unconfirmedTxList":[{"amout":"210000000","fee":2431,"input":[{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","amount":10000000,"index":0},{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","amount":200000000,"index":1}],"opReturn":"test in","output":[{"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","amount":10000000,"index":0},{"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","amount":199997569,"index":1}],"txTimestamp":"1636180054032"},{"amout":"110000000","fee":531,"input":[{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","amount":10000000,"index":0},{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","amount":100000000,"index":1}],"opReturn":"hi","output":[{"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","amount":10000000,"index":0},{"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","amount":99999469,"index":1}],"txTimestamp":"1636180054239"}],"sign":"111111111111111000000000"}
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    2000 The address has not been used. 地址从未被使用 address
    2008 The address has no unconfirmed transaction. 该地址没有未确认交易。 address
    • 示例
    {
        "code":2008,
        "msg":"The address has no unconfirmed transaction.",
        "data":{
            "address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
        }
    }
    

    7. 向导接口

    名称

    guide

    说明

    获取某个地址第一笔fch来源交易的第一个输入地址,作为将该地址引入应用的向导。

    请求参数

    name type description
    address string FCH address
    • 返回参数
    name type description
    guide string The first input address of the first transaction in which requesting address get fch for the first time.
    height uint The latest block height when getting the balance
    • 示例

    查询FEk41Kqjar45fLDriztUDTUkdki7mmcjWK的向导,即第一个向其发送fch的地址。

    参数

    {
    	"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/guide?address=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&timestamp=1635513688254
    
    - sign = sha256(sha256(https://www.sign.cash/api/guide?address=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=3076469fe7036156cabf1e65c8654fe7743eb8cb0b486287665c8e0245631f91
    
    - signedRequest:
    
    https://www.sign.cash/api/guide?address=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=3076469fe7036156cabf1e65c8654fe7743eb8cb0b486287665c8e0245631f91
    

    POST

    - URL:https://www.sign.cash/api/guide
    
    - unsignedRequest:
    
    {"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","timestamp":1635513688254,"url":"https://www.sign.cash/api/guide"}
    
    - sign = sha256(sha256({"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","timestamp":1635513688254,"url":"https://www.sign.cash/api/guide","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=9c2f069edabe125350e8387175f1b48298a35308ed26811303c5433259f72cf1
    
    - signedRequest:
    
    {"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","timestamp":1635513688254,"url":"https://www.sign.cash/api/guide","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"111111111111111000000000"}
    
    

    响应参数

    name type description
    guide string The first input address of the first transaction in which the requested address get fch for the first time.
    height uint The latest block height when getting the balance
    • 示例
    {
        "guide": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
        "heignt": 963667
    }
    
    排序、压缩、签名后:
    
    {"guide":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","heignt":963667,"sign":"111111111111111000000000"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    2000 The address has not been used. 地址从未被使用 address
    • 示例
    {
        "code":2000,
        "msg":"The address has not been used.",
        "data":{
            "address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts"
        }
    }
    

    8. OpReturn搜索接口

    名称

    opReturnSearch

    说明

    模糊搜索通过OpReturn保存在链上的内容。

    请求参数

    name type description required
    searchContent string array Texts searched in Op-Return Y
    filterSigner string Filter by the address of the first input. N
    filterRecipient string Filter by the address of the first output. N
    filterCdd string Filter by cdd N
    filterTxTimestamp string Firlter by txTimestamp N
    sortTxTimestamp string Sort by txTimestamp N
    sortCdd string Sort by cdd N
    sortAmount string Sort by amount N
    count int How many entries the requester wants at a time. N
    sequence int The sequence of requests N
    • 示例

    查询op_return内容中包含”FEIP“和“arm“的交易。

    参数

    {
    	"searchContent": ["FEIP", "arm "],
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/opReturnSearch?searchContent[0]=FEIP&searchContent[1]=arm &timestamp=1635513688254
    
    - sign = sha256(sha256(https://www.sign.cash/api/opReturnSearch?searchContent[0]=FEIP&searchContent[1]=arm &timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=
    951cf8e70506b3934aaad6a4d196041979d1a9ec6727b0f6c3f7e4c132608eee
    
    - signedRequest:
    
    https://www.sign.cash/api/opReturnSearch?searchContent[0]=FEIP&searchContent[1]=arm &timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=
    951cf8e70506b3934aaad6a4d196041979d1a9ec6727b0f6c3f7e4c132608eee
    

    POST

    - URL:https://www.sign.cash/api/opReturnSearch
    
    - unsignedRequest:
    
    {"searchContent":["FEIP","arm "],"timestamp":"1635513688254","url":"https://www.sign.cash/api/opReturnSearch"}
    
    - sign = sha256(sha256({"searchContent":["FEIP","arm "],"timestamp":"1635513688254","url":"https://www.sign.cash/api/opReturnSearch","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=132380a40d6bf911092ee0dbee4cadf01ece764194c97b6ff5eb0197ec9d368a
    
    - signedRequest:
    
    {"searchContent":["FEIP","arm "],"timestamp":"1635513688254","url":"https://www.sign.cash/api/opReturnSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"132380a40d6bf911092ee0dbee4cadf01ece764194c97b6ff5eb0197ec9d368a"}
    

    响应参数

    name type description
    txList object See below
    height uint The latest block height when getting the data.
    • txList
    name type description
    txTimestamp The time stamp of this transaction
    fee uint64 Transaction fee in unit of satoshi
    cdd uint64 The coindays destroyed in this transaction
    opReturn string message in OP_RETURN
    amount uint64 total amount spent
    block uint The height of the block where this transaction was written.
    input object The list of input. See below
    output object The list of output. See below
    • input
    name type description
    index uint The sequence in the input list,counting from 0.
    address string
    amount uint64 In unit of satoshi
    • output
    name type description
    index uint The sequence in the output list,counting from 0.
    address string
    amount uint64 In unit of satoshi
    • 示例
    {
    	"txList": [{
    			"txTimestamp": 1636180054032,
    			"fee": 2431,
    			"cdd": 3600,
    			"opReturn": "FEIP10 by C_armX",
    			"amout": "210000000",
    			"block": 963220,
    			"input": [{
    					"index": 0,
    					"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    					"amount": 10000000
    				},
    				{
    					"index": 1,
    					"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    					"amount": 200000000
    				}
    			],
    			"output": [{
    					"index": 0,
    					"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    					"amount": 10000000
    				},
    				{
    					"index": 1,
    					"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    					"amount": 199997569
    				}
    			]
    		},
    
    		{
    			"txTimestamp": 1636180054239,
    			"fee": 531,
    			"cdd": 230,
    			"opReturn": "Arm And FEIP",
    			"amout": "110000000",
    			"block": 963233,
    			"input": [{
    					"index": 0,
    					"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    					"amount": 10000000
    				},
    				{
    					"index": 1,
    					"address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    					"amount": 100000000
    				}
    			],
    			"output": [{
    					"index": 0,
    					"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    					"amount": 10000000
    				},
    				{
    					"index": 1,
    					"address": "FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts",
    					"amount": 99999469
    				}
    			]
    		}
    	],
    	"heignt": 963667
    }
    排序、压缩、签名后:
    
    {"heignt":963667,"txList":[{"amout":"210000000","block":963220,"cdd":3600,"fee":2431,"input":[{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","amount":10000000,"index":0},{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","amount":200000000,"index":1}],"opReturn":"test in","output":[{"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","amount":10000000,"index":0},{"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","amount":199997569,"index":1}],"txTimestamp":"1636180054032"},{"amout":"110000000","block":963233,"cdd":230,"fee":531,"input":[{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","amount":10000000,"index":0},{"address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","amount":100000000,"index":1}],"opReturn":"hi","output":[{"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","amount":10000000,"index":0},{"address":"FTqiqAyXHnK7uDTXzMap3acvqADK4ZGzts","amount":99999469,"index":1}],"txTimestamp":"1636180054239"}],"sign":""111111111111111000000000""}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
        "code":4000,
        "msg":"No matching record.",
        "data":{
            "address":"https://www.sign.cash/api/opReturnSearch?searchContent[0]=FEIP&searchContent[1]=arm &timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=
    951cf8e70506b3934aaad6a4d196041979d1a9ec6727b0f6c3f7e4c132608eee",
            "count":20,
            "sequence":2
        }
    }
    

    9. 交易广播接口

    名称

    rawTxBroadcast

    说明

    在链上广播已经签名的原始交易。

    请求参数

    name type description
    rawTx string Raw transaction
    • 示例

    广播一笔原始交易。

    参数

    {
    	"rawTx": "0222222222222222222222222222"
    }
    

    POST

    - URL:https://www.sign.cash/api/rawTxBroadcast
    
    - unsignedRequest:
    
    {"rawTx":"0222222222222222222222222222","timestamp":1635513688254,"url":"https://www.sign.cash/api/rawTxBroadcast"}
    
    - sign = sha256(sha256({"rawTx":"0222222222222222222222222222","timestamp":1635513688254,"url":"https://www.sign.cash/api/rawTxBroadcast","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111111111112222222222222222222222223333333333
    
    - signedRequest:
    
    {"rawTx":"0222222222222222222222222222","timestamp":1635513688254,"url":"https://www.sign.cash/api/rawTxBroadcast","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111111111112222222222222222222222223333333333"}
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功 txid
    1 Unknown error. 未知错误 signedRequest
    • 示例
    {
        "code":0,
        "msg":"OK",
        "data":{
            "txid":"02222222333ddddddddddd"
        }
    }
    
    posted in Protocol/协议
  • FIPA2V3_Signature(en-US)
    FIPA2: Signature
    Version: 3
    Language: en-US
    Author: C_armX
    Status: draft
    Created date: 2021-12-11
    LastModifiedDate:2021-12-11
    File hash: "unknown"
    TXid: 
    

    FIPA2V3_Signature(en-US)

    Contents

    Introduction

    General rules of FIPA type protocols

    Rules specific to this protocol

    Introduction

    ProtocolType: FIPA
    SerialNumber: 2
    ProtocolName: Signature
    VersionNumber: 3
    Description : Define the json of the signature data.
    Author: C_armX,Free_Cash
    Language: en-US
    Tags: FIPA, Signature
    PreVersionHash:"c1238989a08029c6abf3caf294c5c6589abaf80c64bd1dd2ce3e7bfc44e3a83a"

    General rules of FIPA protocols

    FIPA protocols make improvements to the FCH ecosystem. These improvements will not lead to a hard fork of the main network, and will not write information on the blockchain.

    Rules specific to this protocol

    1. This protocol defines the data format of Freecash ecological message signature.

    2. The default signature algorithm is ecdsa signature algorithm with Base64 encoding.

    3. Data is in JSON.

    4. The signatures are transmitted in the following format:

    name type description required
    algorithm string Signature algorithm, the default is "ecdsa". Not case sensitive. N
    message string Raw message Y
    address string FCH address of the signer Y
    signature string The signature encoded with Base64 Y
    • example

    signer: FEk41Kqjar45fLDriztUDTUkdki7mmcjWK

    publicKey: 030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a

    privateKey: L2bHRej6Fxxipvb4TiR5bu1rkT3tRp8yWEsUy4R1Zb8VMm2x7sd8

    {
    "algorithm": "ecdsa",
    "message":"test", 
    "address":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    "signature":"HzNqRToLHsY6TrhVB+RjWuk7PqeJhUESINxcL0521mWqU3+rw+NeIGNnOV06ngCLwHD69jCfqHcXWCXuCnIkCGo\u003d"
    }
    
    posted in Protocol/协议
  • RE: APIP10V1_OrganizationInfo(zh-CN)

    5. 组织成员搜索接口

    名称

    oidMemberSearch

    说明

    在活跃成员中模糊查询某oid组织的某个cid或地址,不区分大小写。

    请求参数

    name type description required
    oid string Y
    searchMember string Text searched in the field of cid and Address of the organization members Y
    • 示例

    搜索包含“arm”的cid或address。

    参数

    {
    	"oid": "000000001111111111111111111111122222222222222222222222222",
        "searchMember": "arm",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/oidMemberSearch?oid=000000001111111111111111111111122222222222222222222222222&searchMember=arm&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/oidMemberSearch?oid=000000001111111111111111111111122222222222222222222222222&searchMember=arm&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/oidMemberSearch?oid=000000001111111111111111111111122222222222222222222222222&searchMember=arm&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/oidMemberSearch
    
    - unsignedRequest:
    
    {"oid":"000000001111111111111111111111122222222222222222222222222","searchMember":"arm","timestamp":"1635513688254","url":"https://www.sign.cash/api/oidMemberSearch"}
    
    - sign =sha256(sha256({"oid":"000000001111111111111111111111122222222222222222222222222","searchMember":"arm","timestamp":"1635513688254","url":"https://www.sign.cash/api/oidMemberSearch"},"secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"oid":"000000001111111111111111111111122222222222222222222222222","searchMember":"arm","timestamp":"1635513688254","url":"https://www.sign.cash/api/oidMemberSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    
    

    响应参数

    |name|type|description|key in FEIP28|
    |:---|:---|:---|
    |memberList|string array|List of CID and Address including value of the searchMember|
    |height|uint|The latest block height when getting the data.|

    • 示例

    响应搜索包含“arm”的cid或address。

    {
    	"oid": "000000001111111111111111111111122222222222222222222222222",
    	"memberList": ["C_armX", "Duck_karm", "FEk41Kqjar45fLDriztUDTUkdki7mmcARM"],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"oid":"000000001111111111111111111111122222222222222222222222222","height":989430,"memberList":["C_armX","Duck_karm","FEk41Kqjar45fLDriztUDTUkdki7mmcARM"],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
    	"code": 4000,
    	"msg": "No matching record.",
    	"data": {
    		"signedRequest": "https://www.sign.cash/api/cappSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000"
    	}
    }
    

    6. 我的组织列表接口

    名称

    myOrganizationList

    说明

    模糊查询某address当前拥有、当前参与、担任管理员、声明退出或已经退出的组织列表。

    请求参数

    name type description required
    address string Y
    filterMemberStatus string enum Filter by the status of members, including "owner", "active", "administrators", "exiting"(declared exit but not be delisted), and "delisted" five status.
    • 示例

    搜索F888888888888888888888888888x参与的所有组织。

    参数

    {
    	"address": "F888888888888888888888888888x",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/myorganizationList?address=F888888888888888888888888888x&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/myorganizationList?address=F888888888888888888888888888x&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/myorganizationList?address=F888888888888888888888888888x&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/myorganizationList
    
    - unsignedRequest:
    
    {"address":"F888888888888888888888888888x","timestamp":1635513688254,"url":"https://www.sign.cash/api/myorganizationList"}
    
    - sign
    =sha256(sha256({"address":"F888888888888888888888888888x","timestamp":1635513688254,"url":"https://www.sign.cash/api/myorganizationList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"address":"F888888888888888888888888888x","timestamp":1635513688254,"url":"https://www.sign.cash/api/myorganizationList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    
    

    响应参数

    name type description
    oidInfoList object See below.
    height uint The latest block height when getting the data.
    • oidInfoList
    name type description key in FEIP28
    memberStatus string enum Filter by the status of members, including "owner", "active", "administrators", "exiting"(declared exit but not be delisted), and "delisted" five status.
    oid string
    desc string Description of this organization data.desc
    activeMemberNumber uint64 The number of active members of this organization
    sponsor string The signer of the first input of the transaction in which the organization was registered.
    updater string The signer of the first input of the transaction in which the organization was updated recently.
    firstTime timeStamp The timeStamp of the transaction in which the organization was registered.
    lastTxid string The txid of the last operation of the organization.
    lastTime timeStamp The transaction timestamp of the last operation of the organization.
    tCdd uint64 The total destroyed coindays of all transactions where the value of data.op is "rate".
    • 示例

    响应搜索F888888888888888888888888888x参与的所有组织。

    {
    	"oidInfoList": [{
    			"memberStatus": "active",
    			"oid": "000000001111111111111111111111122222222222222222222222222",
    			"owner": "F000000000000001",
    			"stdName": "Love the earth",
    			"localName": ["爱护地球", "地球を愛する"],
    			"desc": "欢迎来到密码公司",
    			"activeMemberNumber": 2340,
    			"firstTxid": "55553333333333333333333333338888888888888888888888888xxxx",
    			"firstTime": 1610261291834,
    			"lastTxid": "3333333333333333333333333333388888888888888888888888888889",
    			"lastTime": 1636526891228,
    			"tCdd": 230000,
    			"tRate": 4.65
    		},
    		{
    			"memberStatus": "exited",
    			"oid": "2222222200000000000000000001111111111111111333333333333333",
    			"owner": "F000000000000002",
    			"stdName": "Digital home",
    			"localName": ["数字家园", "地球を愛する"],
    			"desc": "数字社区欢迎你!",
    			"activeMemberNumber": 102,
    			"firstTxid": "8888333333333333333333338888888888888888888888888uuuu",
    			"firstTime": 1610002234228,
    			"lastTxid": "1111112200000000000000000001111111111111111333333333333333",
    			"lastTime": 1626522299821,
    			"tCdd": 3000,
    			"tRate": 4.35
    		}
    
    	],
    	"height": 989430
    }
    
    

    排序、压缩、签名后:

    {"height":989430,"oidInfoList":[{"activeMemberNumber":2340,"desc":"欢迎来到密码公司","firstTime":"1610261291834","firstTxid":"55553333333333333333333333338888888888888888888888888xxxx","lastTime":"1636526891228","lastTxid":"3333333333333333333333333333388888888888888888888888888889","localName":["地球を愛する","爱护地球"],"memberStatus":"active","oid":"000000001111111111111111111111122222222222222222222222222","owner":"F000000000000001","stdName":"Love the earth","tCdd":230000,"tRate":4.65},{"activeMemberNumber":102,"desc":"数字社区欢迎你!","firstTime":"1610002234228","firstTxid":"8888333333333333333333338888888888888888888888888uuuu","lastTime":"1626522299821","lastTxid":"1111112200000000000000000001111111111111111333333333333333","localName":["地球を愛する","数字家园"],"memberStatus":"exited","oid":"2222222200000000000000000001111111111111111333333333333333","owner":"F000000000000002","stdName":"Digital home","tCdd":3000,"tRate":4.35}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
    	"code": 4000,
    	"msg": "No matching record.",
    	"data": {
    		"signedRequest": "https://www.sign.cash/api/myorganizationList?address=F888888888888888888888888888x&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000"
    	}
    }
    

    7. 组织评价历史接口

    名称

    oidRateList

    说明

    查询对某oid组织的评价信息,即data.op值为“rate”的记录。

    请求参数

    name type description required
    oid string Y
    filterRate uint Filter by data.rate N
    filterCdd string Filter by cdd N
    filterTxTimestamp string Filter by txTimestamp N
    filterRater string Filter by the address of the first input of the rating transaction N
    sortTxTimestamp string Sort by txTimestamp N
    sortCdd string Sort by cdd N
    sortRate string Sort by data.rate N
    sortRater string Sort by the address of the first input of the rating transaction N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批查询20项oid为000000001111111111111111111111122222222222222222222222222的组织的币天销毁大于1000的评分记录,按评分降序。

    参数

    {
    	"oid": "000000001111111111111111111111122222222222222222222222222",
    	"filterCdd": "1000-",
    	"sortRate": "down",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/oidRateList?count=20&filterCdd=1000-&oid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/oidRateList?count=20&filterCdd=1000-&oid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111111110000000000000000000000222222
    
    - signedRequest:
    
    https://www.sign.cash/api/oidRateList?count=20&filterCdd=1000-&oid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000222222
    

    POST

    - URL:https://www.sign.cash/api/organizationSearch
    
    - unsignedRequest:
    
    {"count":20,"filterCdd":"1000-","oid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/organizationSearch"}
    
    - sign =sha256(sha256({"count":20,"filterCdd":"1000-","oid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/organizationSearch","url":"https://www.sign.cash/api/organizationSearch","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":20,"filterCdd":"1000-","oid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/organizationSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    oid string
    rateList object See below.
    height uint The latest block height when getting the data.
    • rateList
    name type description
    rater uint The address of the first input of the rating transaction
    rate uint
    cdd uint64
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例
      响应oid为000000001111111111111111111111122222222222222222222222222的组织信息。
    {
    	"oid": "000000001111111111111111111111122222222222222222222222222",
    	"rateList ": [{
    			"rater": "FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy",
    			"rate": 5,
    			"cdd": 3100,
    			"txid": "3333333333333333333333333333388888888888888888888888888889",
    			"txTimestamp": 1618832997321,
    			"block": 989302
    		},
    		{
    			"rater": "FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash",
    			"rate": 4,
    			"cdd": 10000,
    			"txid": "4444444333333333333333333333388888888888888888888888888889",
    			"txTimestamp": 1618834297302,
    			"block": 989302
    		}
    
    	],
    	"height": 989430
    }
    
    

    排序、压缩、签名后:

    
    {"height":989430,"oid":"000000001111111111111111111111122222222222222222222222222","rateList ":[{"block":989302,"cdd":3100,"rate":5,"rater":"FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy","txTimestamp":"1618832997321","txid":"3333333333333333333333333333388888888888888888888888888889"},{"block":989302,"cdd":10000,"rate":4,"rater":"FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash","txTimestamp":"1618834297302","txid":"4444444333333333333333333333388888888888888888888888888889"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    1102 The OID does not exist. 该OID不存在。 oid
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
    	"code": 7002,
    	"msg": "The OID does not exist.",
    	"data": {
    		"oid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    
    posted in Protocol/协议
  • APIP10V1_OrganizationInfo(zh-CN)
    APIP10V1_OrganizationInfo(zh-CN)
    Version:1
    Language:zh-CN
    Author:C_armX
    Status:draft
    Createddate:2021-12-03
    Update:2021-12-03
    Filehash:""
    TXid:
    

    APIP10V1_OrganizationInfo(zh-CN)


    目录

    关于APIP

    本协议的基本共识

    1.组织概况接口

    2.组织成员接口

    3.组织历史接口

    4.组织搜索接口

    5.组织成员搜索接口

    6.我的组织列表接口

    7.组织评价接口


    Type:APIP
    SerialNumber:10
    ProtocolName:OrganizationInfo
    Version:1
    Description:定义组织信息查询接口。
    Author:C_armX
    Language:zh-CN
    tags:APIP, API, organization, op_return
    preVersionHash:""
    

    关于APIP

    1. APIP(Application Programming Interface Protocols)是自由共识生态协议的一种类型,用于创建开放的API文档,并且按照《FEIP1_FreeProtocol》协议发布在Freecash主链上。

    2. API的URL路径由服务方按照《FEIP29_Service》协议发布在Freecash主链上。

    3. APIP类型协议的一般共识在《APIP1_OpenAPI》中描述,包括接口标识、连接方式、请求方式、数据验证、常用参数、筛选与排序方式等。

    4. 按照《APIP1_OpenAPI》,API请求方向API服务方请求连接请求数据的流程概括如下:

      • 建立连接:请求方通过connect接口提交私钥签名,请求连接API服务,成功后获得对称密钥secretKey用于数据请求和验证。

      • 准备参数:请求数据时,在请求参数中加入timestamp,采用POST方法时,还需加入API的url

      • 参数排序:所有请求参数按字母升序排列,不区分大小写。

      • 数据签名:将secretKey追加至参数末尾,然后经两次sha256哈希获得签名sign

      • 发送请求:删除secretKey字段,将requestersign追加至末尾,发送给服务方。

      • 验证请求:API服务方验证requester授权、signtimestamp、POST方法url等均有效或正确后予以响应。

      • 响应数据:响应数据尾部加入secretKey后做两次sha256哈希获得sign,再用sign替换secretKey后将数据返回请求方。

      • 验证数据:请求方获得数据后,用secretKey替换sign后哈希签名,值与sign值一致则接受数据。

    本协议的基本共识

    1. 本协议接口提供链上注册的各种组织的相关信息。

    2. 创建组织的交易的txid为该组织的唯一身份,即oid

    3. 为防范垃圾信息攻击,创建或更新组织至少应当销毁1000cd申请、邀请、加入、授权至少应销毁10cd

    4. 本协议接口的数据来源和相关规则遵循以下协议:

      • 《FEIP28_Organization》
    5. 本协议接口数据采用JSON格式。

    6. 示例数据:

    requester的地址:FEk41Kqjar45fLDriztUDTUkdki7mmcjWK
    
    requester的公钥:030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a
    
    requester的私钥:L2bHRej6Fxxipvb4TiR5bu1rkT3tRp8yWEsUy4R1Zb8VMm2x7sd8
    
    requester的secretKey:d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09
    
    apiURL:https://www.sign.cash/api/
    

    1.组织概况接口

    名称

    oidInfoList

    说明

    给定一个或多个oid获取除成员列表以外的组织信息。

    请求参数

    name type description
    oidList string array
    • 示例

    查询oid为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的组织最新详情。

    参数

    {
    	"oidList": ["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/oidInfoList?oid=00000000000000000000000000111111111111111132222222222222&oid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/oidInfoList?oid=00000000000000000000000000111111111111111132222222222222&oid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=33333333333335555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/oidInfoList?oid=00000000000000000000000000111111111111111132222222222222&oid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=33333333333335555555555522222222211111111111111111111111111111
    

    POST

    - URL:https://www.sign.cash/api/oidInfoList
    
    - unsignedRequest:
    
    {"oidList": ["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/oidInfoList"}
    
    - sign =sha256(sha256({"oidList":["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/oidInfoList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=555555555555555555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    {"oidList":["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/oidInfoList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"555555555555555555555555522222222211111111111111111111111111111"}
    

    响应参数

    name type description
    oidInfoList object See below.
    height uint The latest block height when getting the data.
    • oidInfoList
    name type description key in FEIP28
    oid string
    owner string The address of the owner
    stdName string array Standard name of the organization data.stdName
    localName string array Names in different languages data.localName
    desc string Description of this organization data.desc
    activeMemberNumber uint64 The number of active members of this organization
    firstTxid string Txid of the transaction that created the organization.
    firstTime timeStamp The timeStamp of the transaction in which the organization was created.
    lastTxid string The txid of the last operation of the organization.
    lastTime timeStamp The transaction timestamp of the last operation of the organization.
    tCdd uint64 The total destroyed coindays of all transactions where the value of data.op is "rate".
    tRate float Cumulative rating score. tRate=(tCdd*tRate+cdd*rate)/(tCdd+cdd)
    • 示例
      响应id为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的组织除成员列表以外的最新信息。
    {
    	"oidInfoList": [{
    			"oid": "000000001111111111111111111111122222222222222222222222222",
    			"owner": "F000000000000001",
    			"stdName": "Love the earth",
    			"localName": ["爱护地球", "地球を愛する"],
    			"desc": "欢迎来到密码公司",
    			"activeMemberNumber": 2340,
    			"firstTxid": "55553333333333333333333333338888888888888888888888888xxxx",
    			"firstTime": 1610261291834,
    			"lastTxid": "3333333333333333333333333333388888888888888888888888888889",
    			"lastTime": 1636526891228,
    			"tCdd": 230000,
    			"tRate": 4.65
    		},
    		{
    			"oid": "2222222200000000000000000001111111111111111333333333333333",
    			"owner": "F000000000000002",
    			"stdName": "Digital home",
    			"localName": ["数字家园", "地球を愛する"],
    			"desc": "数字社区欢迎你!",
    			"activeMemberNumber": 102,
    			"firstTxid": "8888333333333333333333338888888888888888888888888uuuu",
    			"firstTime": 1610002234228,
    			"lastTxid": "1111112200000000000000000001111111111111111333333333333333",
    			"lastTime": 1626522299821,
    			"tCdd": 3000,
    			"tRate": 4.35
    		}
    
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"height":989430,"oidInfoList":[{"activeMemberNumber":2340,"desc":"欢迎来到密码公司","firstTime":"1610261291834","firstTxid":"55553333333333333333333333338888888888888888888888888xxxx","lastTime":"1636526891228","lastTxid":"3333333333333333333333333333388888888888888888888888888889","localName":["地球を愛する","爱护地球"],"oid":"000000001111111111111111111111122222222222222222222222222","owner":"F000000000000001","stdName":"Love the earth","tCdd":230000,"tRate":4.65},{"activeMemberNumber":102,"desc":"数字社区欢迎你!","firstTime":"1610002234228","firstTxid":"8888333333333333333333338888888888888888888888888uuuu","lastTime":"1626522299821","lastTxid":"1111112200000000000000000001111111111111111333333333333333","localName":["地球を愛する","数字家园"],"oid":"2222222200000000000000000001111111111111111333333333333333","owner":"F000000000000002","stdName":"Digital home","tCdd":3000,"tRate":4.35}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    1100 These OIDs do not exist. 这些OID不存在。 missedOidList
    1101 Too many OIDs are requested. 请求的OID数量太多。 maxOidCount
    • 示例
    {
    	"code": 1100,
    	"msg": "These OIDs do not exist.",
    	"data": {
    		"missedOidList": ["2222222200000000000000000001111111111111111333333333333333"]
    	}
    }
    

    2. 组织成员列表接口

    名称

    memberList

    说明

    获取oid的各种状态的成员列表

    请求参数

    name type description
    oid string
    filterMemberStatus string enum Filter by the status of members, including "owner", "active", "administrators", "exiting"(declared exit but not be delisted), and "delisted" five status.
    • 示例

    查询oid为00000000000000000000000000111111111111111132222222222222的组织最新详情。

    参数

    {
    	"oid": "00000000000000000000000000111111111111111132222222222222",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/memberList?oid=00000000000000000000000000111111111111111132222222222222&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/memberList?oid=00000000000000000000000000111111111111111132222222222222&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=33333333333335555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/memberList?oid=00000000000000000000000000111111111111111132222222222222&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=33333333333335555555555522222222211111111111111111111111111111
    

    POST

    - URL:https://www.sign.cash/api/memberList
    
    - unsignedRequest:
    
    {"oid":"00000000000000000000000000111111111111111132222222222222","timestamp":"1635513688254","url":"https://www.sign.cash/api/memberList"}
    
    - sign =sha256(sha256({"oid":"00000000000000000000000000111111111111111132222222222222","timestamp":"1635513688254","url":"https://www.sign.cash/api/memberList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=555555555555555555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    {"oid":"00000000000000000000000000111111111111111132222222222222","timestamp":"1635513688254","url":"https://www.sign.cash/api/memberList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"555555555555555555555555522222222211111111111111111111111111111"}
    

    响应参数

    name type description key in FEIP28
    oid string
    activeMembers string array The address list of active members.
    exitingMembers string array The address list of members who declared exit but have not been delisted.
    administrators string array The address list of administrators.
    delistedMembers string array The address list of exited members.
    height uint The latest block height when getting the data.
    • 示例
      响应oid为00000000000000000000000000111111111111111132222222222222的所有成员列表。
    {
    	"oid": "000000001111111111111111111111122222222222222222222222222",
    	"owner": "F000000000000001",
    	"activeMembers": ["F1111111111111S", "F2222222222222222Z", "F33333333333333333333h", "F4444444444444444444N"],
    	"administrators": ["F1111111111111S", "F2222222222222222Z"],
    	"exitingMembers": ["F555555555555555555x ", "F66666666666666666666666z "],
    	"delistedMembers": ["F77777777777777777e"],
    	"height": 989430
    }
    
    

    排序、压缩、签名后:

    {"activeMembers":["F1111111111111S","F2222222222222222Z","F33333333333333333333h","F4444444444444444444N"],"administrators":["F1111111111111S","F2222222222222222Z"],"delistedMembers":["F77777777777777777e"],"exitingMembers":["F555555555555555555x ","F66666666666666666666666z "],"height":989430,"oid":"000000001111111111111111111111122222222222222222222222222","owner":"F000000000000001","sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    1102 The OID does not exist. 该OID不存在。 oid
    • 示例
    {
    	"code": 1102,
    	"msg": "The OID does not exist.",
    	"data": {
    		"oid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    

    3. 组织历史接口

    名称

    oidHistory

    说明

    查询某oid组织除了rate操作以外的所有历史操作记录。

    请求参数

    name type description required
    oid string Y
    filterSigner string Filter by the signer, the address of the first input of the transaction. N
    filterOp string enum Filter by data.op, Including 10 other operations besides "rate". N
    filterTxTimestamp string Filter by txTimestamp N
    sortOp string enum Sort by data.op N
    sortTxTimestamp string Sort by txTimestamp N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批查询20项oid为000000001111111111111111111111122222222222222222222222222的组织操作记录,按txTimestamp降序。

    参数

    {
    	"oid": "000000001111111111111111111111122222222222222222222222222",
    	"sortTxTimestamp": "down",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/oidHistory?count=20&oid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortTxTimestamp=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/oidHistory?count=20&oid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortTxTimestamp=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/oidHistory?count=20&filteOp=rate&filterCdd=1000-&oid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/oidHistory
    
    - unsignedRequest:
    
    {"count":20,"oid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortTxTimestamp":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/oidHistory"}
    
    - sign =sha256(sha256({"count":20,"filteOp":"rate","filterCdd":"1000-","oid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/oidHistory","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":20,"filteOp":"rate","filterCdd":"1000-","oid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/oidHistory","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    oid string
    opList object See below.
    height uint The latest block height when getting the data.
    • opList
    name type description key in FEIP28
    op string The operation. data.op
    signer string The signer of the first input of the transaction.
    recipients string array Addresses of outputs
    localName string array Names in different languages. data.localName
    desc string Description of this organization. data.desc
    days int 2 Validity period of the invitation.
    txTimestamp timestamp The timestamp of this transaction
    txid string The txid of this transaction.
    cdd uint64 Coindays destroyed of this transaction
    block uint The height of the block where the transaction is written
    • 示例

    响应第2批查询20项oid为000000001111111111111111111111122222222222222222222222222的组织操作记录,按txTimestamp降序。

    {
    	"oid": "000000001111111111111111111111122222222222222222222222222",
    	"opList": [{
    			"op": "join",
    			"signer": "F11111111111",
    			"recipients": ["F1111111111", "F2222222222222", "F33333333333"],
    			"txTimestamp": 1613211239,
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"cdd": 2300,
    			"block": 989239
    		},
    
    		{
    			"op": "update",
    			"signer": "F11111111111",
    			"recipients": ["F1111111111"],
    			"localName": ["天文爱好者", "Astronomers"],
    			"desc": "开放的天文爱好者组织",
    			"txTimestamp": 1610261291,
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"cdd": 11300,
    			"block": 989021
    		}
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"oid":"000000001111111111111111111111122222222222222222222222222","opList":[{"block":989239,"cdd":2300,"op":"join","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","txTimestamp":1613211239,"txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866"},{"block":989021,"cdd":11300,"desc":"密码学院讨论组织","name":"crypto school","op":"update","txTimestamp":1610261291,"txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866"}],"height":989430,"name":"crypto circle","sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    1102 The OID does not exist. 该OID不存在。 oid
    • 示例
    {
    	"code": 1102,
    	"msg": "The OID does not exist.",
    	"data": {
    		"oid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    

    4.组织搜索接口

    名称

    organizationSearch

    说明

    按条件查询组织。

    请求参数

    name type description required
    filterStdName string Filter by the data.stdName N
    filterLocalName string Filter by the data.localName N
    filterDesc string Filter by data.desc N
    filterActiveMemberNumber uint Filter by the number of active members. N
    filterFirstTime string Filter by the time of the creating. N
    filterLastTime string Filter by the time of the last operation. N
    filterTCdd string Filter by tCdd which is the total destroyed coindays of all transactions where the value of data.op is "rate". N
    filterTRate string Filter by tRate N
    sortActiveMemberNumber uint Sort by the number of active members N
    sortFirstTime string Sort by firstTime N
    sortLastTime string Sort by the last operation. N
    sortTCdd string Sort by tCdd N
    sortStdName string Sort by the data.stdName N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    查询2项名称中包含为“Crypto”,累计销毁币天tCdd大于1000的组织,结果按创建时间倒序排列。

    参数

    {
    	"filterName": "Cryto",
    	"filterTCdd": "1000-",
    	"sortFirstTime": "down",
    	"count": 2,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/organizationSearch?count=2&filterName=Cryto&filterTCdd=1000-&sortFirstTime=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/organizationSearch?count=2&filterName=Cryto&filterTCdd=1000-&sortFirstTime=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/organizationSearch?count=2&filterName=Cryto&filterTCdd=1000-&sortFirstTime=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/organizationSearch
    
    - unsignedRequest:
    
    {"count":2,"filterName":"Cryto","filterTCdd":"1000-","sortFirstTime":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/organizationSearch"}
    
    - sign =sha256(sha256({"count":2,"filterName":"Cryto","filterTCdd":"1000-","sortFirstTime":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/organizationSearch","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":2,"filterName":"Cryto","filterTCdd":"1000-","sortFirstTime":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/organizationSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    oidInfoList object See below.
    height uint The latest block height when getting the data.
    • oidInfoList
    name type description key in FEIP28
    oid string
    owner string The address of the owner
    stdName string array Standard name of the organization data.stdName
    localName string array Names in different languages data.localName
    desc string Description of this organization data.desc
    activeMemberNumber uint64 The number of active members of this organization
    firstTxid string Txid of the transaction that created the organization.
    firstTime timeStamp The timeStamp of the transaction in which the organization was created.
    lastTxid string The txid of the last operation of the organization.
    lastTime timeStamp The transaction timestamp of the last operation of the organization.
    tCdd uint64 The total destroyed coindays of all transactions where the value of data.op is "rate".
    tRate float Cumulative rating score. tRate=(tCdd*tRate+cdd*rate)/(tCdd+cdd)
    • 示例

    响应查询2项名称中包含为“Crypto”,累计销毁币天tCdd大于1000的组织,结果按创建时间倒序排列。

    {
    	"oidInfoList": [{
    			"oid": "000000001111111111111111111111122222222222222222222222222",
    			"owner": "F000000000000001",
    			"stdName": "Love the earth",
    			"localName": ["爱护地球", "地球を愛する"],
    			"desc": "欢迎来到密码公司",
    			"activeMemberNumber": 2340,
    			"firstTxid": "55553333333333333333333333338888888888888888888888888xxxx",
    			"firstTime": 1610261291834,
    			"lastTxid": "3333333333333333333333333333388888888888888888888888888889",
    			"lastTime": 1636526891228,
    			"tCdd": 230000,
    			"tRate": 4.65
    		},
    		{
    			"oid": "2222222200000000000000000001111111111111111333333333333333",
    			"owner": "F000000000000002",
    			"stdName": "Digital home",
    			"localName": ["数字家园", "地球を愛する"],
    			"desc": "数字社区欢迎你!",
    			"activeMemberNumber": 102,
    			"firstTxid": "8888333333333333333333338888888888888888888888888uuuu",
    			"firstTime": 1610002234228,
    			"lastTxid": "1111112200000000000000000001111111111111111333333333333333",
    			"lastTime": 1626522299821,
    			"tCdd": 3000,
    			"tRate": 4.35
    		}
    
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"height":989430,"oidInfoList":[{"activeMemberNumber":2340,"desc":"欢迎来到密码公司","firstTime":"1610261291834","firstTxid":"55553333333333333333333333338888888888888888888888888xxxx","lastTime":"1636526891228","lastTxid":"3333333333333333333333333333388888888888888888888888888889","localName":["地球を愛する","爱护地球"],"oid":"000000001111111111111111111111122222222222222222222222222","owner":"F000000000000001","stdName":"Love the earth","tCdd":230000,"tRate":4.65},{"activeMemberNumber":102,"desc":"数字社区欢迎你!","firstTime":"1610002234228","firstTxid":"8888333333333333333333338888888888888888888888888uuuu","lastTime":"1626522299821","lastTxid":"1111112200000000000000000001111111111111111333333333333333","localName":["地球を愛する","数字家园"],"oid":"2222222200000000000000000001111111111111111333333333333333","owner":"F000000000000002","stdName":"Digital home","tCdd":3000,"tRate":4.35}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
    	"code": 4000,
    	"msg": "No matching record.",
    	"data": {
    		"signedRequest": "https://www.sign.cash/api/organizationSearch?count=2&filterName=Cryto&filterTCdd=1000-&sortFirstTime=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000"
    	}
    }
    

    posted in Protocol/协议
  • APIP9V1_GroupInfo(zh-CN)
    APIP9V1_GroupInfo(zh-CN)
    Version:1
    Language:zh-CN
    Author:C_armX
    Status:draft
    Createddate:2021-12-03
    Update:2021-12-03
    Filehash:""
    TXid:
    

    APIP9V1_GroupInfo(zh-CN)


    目录

    关于APIP

    本协议的基本共识

    1.gid列表接口

    2.群详情接口

    3.群搜索接口

    4.群历史接口

    5.群成员搜索接口

    6.我的群列表接口


    Type:APIP
    SerialNumber:9
    ProtocolName:GroupInfo
    Version:1
    Description:定义群信息查询接口。
    Author:C_armX
    Language:zh-CN
    tags:APIP, API, Group, op_return
    preVersionHash:""
    

    关于APIP

    1. APIP(Application Programming Interface Protocols)是自由共识生态协议的一种类型,用于创建开放的API文档,并且按照《FEIP1_FreeProtocol》协议发布在Freecash主链上。

    2. API的URL路径由服务方按照《FEIP29_Service》协议发布在Freecash主链上。

    3. APIP类型协议的一般共识在《APIP1_OpenAPI》中描述,包括接口标识、连接方式、请求方式、数据验证、常用参数、筛选与排序方式等。

    4. 按照《APIP1_OpenAPI》,API请求方向API服务方请求连接请求数据的流程概括如下:

      • 建立连接:请求方通过connect接口提交私钥签名,请求连接API服务,成功后获得对称密钥secretKey用于数据请求和验证。

      • 准备参数:请求数据时,在请求参数中加入timestamp,采用POST方法时,还需加入API的url

      • 参数排序:所有请求参数按字母升序排列,不区分大小写。

      • 数据签名:将secretKey追加至参数末尾,然后经两次sha256哈希获得签名sign

      • 发送请求:删除secretKey字段,将requestersign追加至末尾,发送给服务方。

      • 验证请求:API服务方验证requester授权、signtimestamp、POST方法url等均有效或正确后予以响应。

      • 响应数据:响应数据尾部加入secretKey后做两次sha256哈希获得sign,再用sign替换secretKey后将数据返回请求方。

      • 验证数据:请求方获得数据后,用secretKey替换sign后哈希签名,值与sign值一致则接受数据。

    本协议的基本共识

    1. 本协议接口提供链上注册的各种群的相关信息。

    2. 币天销毁门槛

      • 由于群为全开放组织方式,防范垃圾信息攻击,API服务方构建群信息库时,应设置建群和进群的币天销毁门槛值。
      • createCdThreshold(建群币天销毁门槛):建群的交易必须销毁的最小币天,低于此门槛值的新建群不进入群数据库。
      • joinCdThreshold(进群币天销毁门槛):进群的交易必须销毁的最小币天,低于此门槛值的进群申请者,不进入群成员数据库。
      • 门槛值由API服务方自主动态调整,随着群数据的增长逐渐调高。
    3. 本协议接口的数据来源遵循以下协议:

      • 《FEIP19_Group》
    4. 本协议接口数据采用JSON格式。

    5. 示例数据:

    requester的地址:FEk41Kqjar45fLDriztUDTUkdki7mmcjWK
    
    requester的公钥:030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a
    
    requester的私钥:L2bHRej6Fxxipvb4TiR5bu1rkT3tRp8yWEsUy4R1Zb8VMm2x7sd8
    
    requester的secretKey:d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09
    
    apiURL:https://www.sign.cash/api/
    

    1.gid列表接口

    名称

    gidInfoList

    说明

    给定一个或多个gid获取除成员列表以外的群信息。

    请求参数

    name type description
    gidList string array
    • 示例

    查询gid为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的群最新详情。

    参数

    {
    	"gidList": ["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/gidInfoList?gid=00000000000000000000000000111111111111111132222222222222&gid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/gidInfoList?gid=00000000000000000000000000111111111111111132222222222222&gid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=33333333333335555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/gidInfoList?gid=00000000000000000000000000111111111111111132222222222222&gid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=33333333333335555555555522222222211111111111111111111111111111
    

    POST

    - URL:https://www.sign.cash/api/gidInfoList
    
    - unsignedRequest:
    
    {"gidList": ["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/gidInfoList"}
    
    - sign =sha256(sha256({"gidList":["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/gidInfoList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=555555555555555555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    {"gidList":["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/gidInfoList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"555555555555555555555555522222222211111111111111111111111111111"}
    

    响应参数

    name type description
    gidInfoList object See below.
    height uint The latest block height when getting the data.
    • gidInfoList
    name type description key in FEIP19
    gid string The ID of the group,that is,the txid of the transaction in which the group was registered.
    name string The name of the group in english data.name
    desc string Description of this group data.desc
    memberNumber uint64 The number of active members of this group
    sponsor string The signer of the first input of the transaction in which the group was registered.
    updater string The signer of the first input of the transaction in which the group was updated recently.
    firstTime timeStamp The timeStamp of the transaction in which the group was registered.
    lastTxid string The txid of the last update of the group.
    lastTime timeStamp The transaction timestamp of the last update of the group.
    tCdd uint64 All destroyed coindays accumulated by all transactions where the value of data.op is "create", "update", or "join".
    • 示例
      响应id为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的群除成员列表以外的最新信息。
    {
    	"gidInfoList": [{
    			"gid": "000000001111111111111111111111122222222222222222222222222",
    			"name": "crypto socity",
    			"desc": "欢迎来到密码社区",
    			"memberNumber": 2340,
    			"sponsor": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"updater": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291834,
    			"lastTxid": "3333333333333333333333333333388888888888888888888888888889",
    			"lastTime": 1636526891228,
    			"tCdd": 12300000
    		},
    		{
    			"gid": "2222222200000000000000000001111111111111111333333333333333",
    			"name": "digital socity",
    			"desc": "数字社区欢迎你!",
    			"memberNumber": 102,
    			"sponsor": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"updater": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    			"firstTime": 1610002234228,
    			"lastTxid": "1111112200000000000000000001111111111111111333333333333333",
    			"lastTime": 1626522299821,
    			"tCdd": 2300000
    		}
    
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"gidInfoList":[{"desc":"欢迎来到密码社区","firstTime":"1610261291834","gid":"000000001111111111111111111111122222222222222222222222222","lastTime":"1636526891228","lastTxid":"3333333333333333333333333333388888888888888888888888888889","memberNumber":2340,"name":"crypto socity","sponsor":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","tCdd":12300000,"updater":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv"},{"desc":"数字社区欢迎你!","firstTime":"1610002234228","gid":"2222222200000000000000000001111111111111111333333333333333","lastTime":"1626522299821","lastTxid":"1111112200000000000000000001111111111111111333333333333333","memberNumber":102,"name":"digital socity","sponsor":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","tCdd":2300000,"updater":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK"}],"height":989430,"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    9000 These GIDs do not exist. 这些GID不存在。 missedGidList
    9001 Too many GIDs are requested. 请求的GID数量太多。 maxGidCount
    • 示例
    {
    	"code": 8000,
    	"msg": "These GIDs do not exist.",
    	"data": {
    		"missedGidList": ["2222222200000000000000000001111111111111111333333333333333"]
    	}
    }
    

    2. 群详情接口

    名称

    gidDetails

    说明

    给定一个gid获取其包括群成员在内的全部信息。

    请求参数

    name type description
    gid string
    • 示例

    查询gid为00000000000000000000000000111111111111111132222222222222的群最新详情。

    参数

    {
    	"gid": "00000000000000000000000000111111111111111132222222222222",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/gidDetails?gid=00000000000000000000000000111111111111111132222222222222&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/gidDetails?gid=00000000000000000000000000111111111111111132222222222222&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=33333333333335555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/gidDetails?gid=00000000000000000000000000111111111111111132222222222222&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=33333333333335555555555522222222211111111111111111111111111111
    

    POST

    - URL:https://www.sign.cash/api/gidDetails
    
    - unsignedRequest:
    
    {"gid":"00000000000000000000000000111111111111111132222222222222","timestamp":"1635513688254","url":"https://www.sign.cash/api/gidDetails"}
    
    - sign =sha256(sha256({"gid":"00000000000000000000000000111111111111111132222222222222","timestamp":"1635513688254","url":"https://www.sign.cash/api/gidDetails","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=555555555555555555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    {"gid":"00000000000000000000000000111111111111111132222222222222","timestamp":"1635513688254","url":"https://www.sign.cash/api/gidDetails","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"555555555555555555555555522222222211111111111111111111111111111"}
    

    响应参数

    name type description key in FEIP19
    gid string The ID of the group,that is,the txid of the transaction in which the group was registered.
    name string The name of the group in english data.name
    desc string Description of this group data.desc
    memberNumber uint64 The number of active members of this group.
    activeMembers string array The address list of active members.
    exitedMembers string array The address list of exited members.
    sponsor string The signer of the first input of the transaction in which the group was registered.
    updater string The signer of the first input of the transaction in which the group was updated recently.
    firstTime timeStamp The timeStamp of the transaction in which the group was registered.
    lastTxid string The txid of the last update of the group.
    lastTime timeStamp The transaction timestamp of the last update of the group.
    tCdd uint64 All destroyed coindays accumulated by all transactions where the value of data.op is "create", "update", or "join".
    height uint The latest block height when getting the data.
    • 示例
      响应id为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的群最新详情。
    {
    	"gid": "000000001111111111111111111111122222222222222222222222222",
    	"name": "crypto socity",
    	"desc": "欢迎来到密码社区",
    	"memberNumber": 4,
    	"activeMembers": ["F1111111111111S", "F2222222222222222Z", "F33333333333333333333h", "F4444444444444444444NC7N"],
    	"exitedMembers": ["F555555555555555S", "F666666666666666666666Z"],
    	"sponsor": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    	"updater": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    	"firstTime": 1610261291834,
    	"lastTxid": "3333333333333333333333333333388888888888888888888888888889",
    	"lastTime": 1636526891228,
    	"tCdd": 12300000,
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"activeMembers":["F1111111111111S","F2222222222222222Z","F33333333333333333333h","F4444444444444444444NC7N"],"desc":"欢迎来到密码社区","exitedMembers":["F555555555555555S","F666666666666666666666Z"],"firstTime":"1610261291834","gid":"000000001111111111111111111111122222222222222222222222222","height":989430,"lastTime":"1636526891228","lastTxid":"3333333333333333333333333333388888888888888888888888888889","memberNumber":4,"name":"crypto socity","sponsor":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","tCdd":12300000,"updater":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    9002 The GID does not exist. 该GID不存在。 gid
    • 示例
    {
    	"code": 9002,
    	"msg": "The GID does not exist.",
    	"data": {
    		"gid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    

    3.群搜索接口

    名称

    groupSearch

    说明

    按条件查询群。

    请求参数

    name type description required
    filterName string Filter by the data.name N
    filterDesc string Filter by data.desc N
    FilterSponsor string Filter by the sponsor.
    FilterUpdater string Filter by the last updater.
    filterMemberNumber uint64 Filter by the number of active members. N
    filterFirstTime string Filter by firstTime N
    filterLastTime string Filter by lastTime N
    filterTCdd string Filter by tCdd which is all destroyed coindays accumulated by all transactions where the value of data.op is "create", "update", or "join". N
    sortMemberNumber uint64 Sort by the number of active members. N
    sortFirstTime string Sort by firstTime N
    sortLastTime string Sort by lastTime N
    sortTCdd string Sort by tCdd N
    sortName string Sort by the data.ame N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    查询2项名称中包含为“Crypto”,累计销毁币天tCdd大于1000的群,结果按创建时间倒序排列。

    参数

    {
    	"filterName": "Cryto",
    	"filterTCdd": "1000-",
    	"sortFirstTime": "down",
    	"count": 2,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/groupSearch?count=2&filterName=Cryto&filterTCdd=1000-&sortFirstTime=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/groupSearch?count=2&filterName=Cryto&filterTCdd=1000-&sortFirstTime=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/groupSearch?count=2&filterName=Cryto&filterTCdd=1000-&sortFirstTime=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/groupSearch
    
    - unsignedRequest:
    
    {"count":2,"filterName":"Cryto","filterTCdd":"1000-","sortFirstTime":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/groupSearch"}
    
    - sign =sha256(sha256({"count":2,"filterName":"Cryto","filterTCdd":"1000-","sortFirstTime":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/groupSearch","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":2,"filterName":"Cryto","filterTCdd":"1000-","sortFirstTime":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/groupSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    gidInfoList object See below.
    height uint The latest block height when getting the data.
    • gidInfoList
    name type description key in FEIP19
    gid string The ID of the group,that is,the txid of the transaction in which the group was registered.
    name string The name of the group in english data.name
    desc string Description of this group data.desc
    memberNumber uint64 The number of active members of this group
    sponsor string The signer of the first input of the transaction in which the group was registered.
    updater string The signer of the first input of the transaction in which the group was updated recently.
    firstTime timeStamp The timeStamp of the transaction in which the group was registered.
    lastTxid string The txid of the last update of the group.
    lastTime timeStamp The transaction timestamp of the last update of the group.
    tCdd uint64 All destroyed coindays accumulated by all transactions where the value of data.op is "create", "update", or "join".
    • 示例
      响应2项名称中包含为“Crypto”,累计销毁币天tCdd大于1000的群,结果按创建时间倒序排列。
    {
    	"gidInfoList": [{
    			"gid": "000000001111111111111111111111122222222222222222222222222",
    			"name": "crypto socity",
    			"desc": "欢迎来到密码社区",
    			"memberNumber": 2340,
    			"sponsor": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"updater": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291834,
    			"lastTxid": "3333333333333333333333333333388888888888888888888888888889",
    			"lastTime": 1636526891228,
    			"tCdd": 300000
    		},
    		{
    			"gid": "2222222200000000000000000001111111111111111333333333333333",
    			"name": "crypto school",
    			"desc": "密码学校欢迎你!",
    			"memberNumber": 102,
    			"sponsor": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"updater": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    			"firstTime": 1610002234228,
    			"lastTxid": "1111112200000000000000000001111111111111111333333333333333",
    			"lastTime": 1626522299821,
    			"tCdd": 2300
    		}
    
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"gidInfoList":[{"desc":"欢迎来到密码社区","firstTime":"1610261291834","gid":"000000001111111111111111111111122222222222222222222222222","lastTime":"1636526891228","lastTxid":"3333333333333333333333333333388888888888888888888888888889","memberNumber":2340,"name":"crypto socity","sponsor":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","tCdd":300000,"updater":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv"},{"desc":"密码学校欢迎你!","firstTime":"1610002234228","gid":"2222222200000000000000000001111111111111111333333333333333","lastTime":"1626522299821","lastTxid":"1111112200000000000000000001111111111111111333333333333333","memberNumber":102,"name":"crypto school","sponsor":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","tCdd":2300,"updater":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK"}],"height":989430,"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
    	"code": 4000,
    	"msg": "No matching record.",
    	"data": {
    		"signedRequest": "https://www.sign.cash/api/groupSearch?count=2&filterName=Cryto&filterTCdd=1000-&sortFirstTime=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000"
    	}
    }
    

    4. 群历史接口

    名称

    gidHistory

    说明

    查询某gid群的所有历史操作记录。

    请求参数

    name type description required
    gid string Y
    filterSigner string Filter by the signer, the address of the first input of the transaction. N
    filterOp string Filter by data.op N
    filterTxTimestamp string Filter by txTimestamp N
    filterCdd string Filter by cdd N
    sortOp string Sort by data.op N
    sortTxTimestamp string Sort by txTimestamp N
    sortCdd string Sort by Cdd N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批查询20项gid为000000001111111111111111111111122222222222222222222222222的群操作记录,按txTimestamp降序。

    参数

    {
    	"gid": "000000001111111111111111111111122222222222222222222222222",
        "sortTxTimestamp": "down",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/gidHistory?count=20&gid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortTxTimestamp=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/gidHistory?count=20&gid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortTxTimestamp=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/gidHistory?count=20&filteOp=rate&filterCdd=1000-&gid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/gidHistory
    
    - unsignedRequest:
    
    {"count":20,"gid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortTxTimestamp":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/gidHistory"}
    
    - sign =sha256(sha256({"count":20,"filteOp":"rate","filterCdd":"1000-","gid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/gidHistory","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":20,"filteOp":"rate","filterCdd":"1000-","gid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/gidHistory","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    |name|type|description|key in FEIP19|
    |:---|:---|:---|
    |gid|string||
    |name|string|The current name of the group|data.name|
    |opList|object|See below.|
    |height|uint|The latest block height when getting the data.|

    • opList
    name type description
    op string The operation.
    signer string The signer of the first input of the transaction
    name string The name of the group
    desc string Description of this group
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    cdd uint64 Coindays destroyed of this transaction
    block uint The height of the block where the transaction is written
    • 示例

    响应第2批查询20项gid为000000001111111111111111111111122222222222222222222222222的群操作记录,按txTimestamp降序。

    {
    	"gid": "000000001111111111111111111111122222222222222222222222222",
    	"name": "crypto circle",
    	"opList": [{
    			"op": "join",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"txTimestamp": 1613211239,
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"cdd": 2300,
    			"block": 989239
    		},
    
    		{
    			"op": "update",
    			"name": "crypto school",
    			"desc": "密码学院讨论群",
    			"txTimestamp": 1610261291,
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"cdd": 11300,
    			"block": 989021
    		}
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"gid":"000000001111111111111111111111122222222222222222222222222","opList":[{"block":989239,"cdd":2300,"op":"join","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","txTimestamp":1613211239,"txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866"},{"block":989021,"cdd":11300,"desc":"密码学院讨论群","name":"crypto school","op":"update","txTimestamp":1610261291,"txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866"}],"height":989430,"name":"crypto circle","sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    9002 The GID does not exist. 该GID不存在。 gid
    • 示例
    {
    	"code": 9002,
    	"msg": "The GID does not exist.",
    	"data": {
    		"gid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    

    5. 群成员搜索接口

    名称

    gidMemberSearch

    说明

    模糊查询某gid群的某个cid或地址,不区分大小写。

    请求参数

    name type description required
    gid string Y
    searchMember string Text searched in the field of cid and Address of the group members Y
    • 示例

    搜索包含“arm”的cid或address。

    参数

    {
    	"gid": "000000001111111111111111111111122222222222222222222222222",
        "searchMember": "arm",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/gidMemberSearch?gid=000000001111111111111111111111122222222222222222222222222&searchMember=arm&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/gidMemberSearch?gid=000000001111111111111111111111122222222222222222222222222&searchMember=arm&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/gidMemberSearch?gid=000000001111111111111111111111122222222222222222222222222&searchMember=arm&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/gidMemberSearch
    
    - unsignedRequest:
    
    {"gid":"000000001111111111111111111111122222222222222222222222222","searchMember":"arm","timestamp":"1635513688254","url":"https://www.sign.cash/api/gidMemberSearch"}
    
    - sign =sha256(sha256({"gid":"000000001111111111111111111111122222222222222222222222222","searchMember":"arm","timestamp":"1635513688254","url":"https://www.sign.cash/api/gidMemberSearch"},"secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"gid":"000000001111111111111111111111122222222222222222222222222","searchMember":"arm","timestamp":"1635513688254","url":"https://www.sign.cash/api/gidMemberSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    
    

    响应参数

    |name|type|description|key in FEIP19|
    |:---|:---|:---|
    |memberList|string array|List of CID and Address including value of the searchMember|
    |height|uint|The latest block height when getting the data.|

    • 示例

    响应搜索包含“arm”的cid或address。

    {
    	"gid": "000000001111111111111111111111122222222222222222222222222",
    	"memberList": ["C_armX", "Duck_karm", "FEk41Kqjar45fLDriztUDTUkdki7mmcARM"],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"gid":"000000001111111111111111111111122222222222222222222222222","height":989430,"memberList":["C_armX","Duck_karm","FEk41Kqjar45fLDriztUDTUkdki7mmcARM"],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
    	"code": 4000,
    	"msg": "No matching record.",
    	"data": {
    		"signedRequest": "https://www.sign.cash/api/cappSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000"
    	}
    }
    

    6. 我的群列表接口

    名称

    myGroupList

    说明

    模糊查询某address当前参与和已经退出的群列表。

    请求参数

    name type description required
    address string Y
    filterMemberStatus string enum Filter by the status of members, including "active" and "exited" two status.
    • 示例

    搜索F888888888888888888888888888x参与的所有群。

    参数

    {
    	"address": "F888888888888888888888888888x",
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/myGroupList?address=F888888888888888888888888888x&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/myGroupList?address=F888888888888888888888888888x&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/myGroupList?address=F888888888888888888888888888x&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/myGroupList
    
    - unsignedRequest:
    
    {"address":"F888888888888888888888888888x","timestamp":1635513688254,"url":"https://www.sign.cash/api/myGroupList"}
    
    - sign
    =sha256(sha256({"address":"F888888888888888888888888888x","timestamp":1635513688254,"url":"https://www.sign.cash/api/myGroupList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"address":"F888888888888888888888888888x","timestamp":1635513688254,"url":"https://www.sign.cash/api/myGroupList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    
    

    响应参数

    name type description
    gidInfoList object See below.
    height uint The latest block height when getting the data.
    • gidInfoList
    name type description key in FEIP19
    memberStatus string enum Filter by the status of members, including "active" and "exited" two status.
    gid string The ID of the group,that is,the txid of the transaction in which the group was registered.
    name string The name of the group in english data.name
    desc string Description of this group data.desc
    memberNumber uint64 The number of active members of this group
    sponsor string The signer of the first input of the transaction in which the group was registered.
    updater string The signer of the first input of the transaction in which the group was updated recently.
    firstTime timeStamp The timeStamp of the transaction in which the group was registered.
    lastTxid string The txid of the last operation of the group.
    lastTime timeStamp The transaction timestamp of the last operation of the group.
    tCdd uint64 All destroyed coindays accumulated by all transactions where the value of data.op is "create", "update", or "join".
    • 示例

    响应搜索F888888888888888888888888888x参与的所有群。

    {
    	"gidInfoList": [{
    			"memberStatus": "active",
    			"gid": "000000001111111111111111111111122222222222222222222222222",
    			"name": "crypto socity",
    			"desc": "欢迎来到密码社区",
    			"memberNumber": 2340,
    			"sponsor": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"updater": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291834,
    			"lastTxid": "3333333333333333333333333333388888888888888888888888888889",
    			"lastTime": 1636526891228,
    			"tCdd": 300000
    		},
    		{
    			"gid": "2222222200000000000000000001111111111111111333333333333333",
    			"memberStatus": "exited",
    			"name": "crypto school",
    			"desc": "密码学校欢迎你!",
    			"memberNumber": 102,
    			"sponsor": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"updater": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK",
    			"firstTime": 1610002234228,
    			"lastTxid": "1111112200000000000000000001111111111111111333333333333333",
    			"lastTime": 1626522299821,
    			"tCdd": 2300
    		}
    
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    {"gidInfoList":[{"desc":"欢迎来到密码社区","exited":0,"firstTime":"1610261291834","gid":"000000001111111111111111111111122222222222222222222222222","lastTime":"1636526891228","lastTxid":"3333333333333333333333333333388888888888888888888888888889","memberNumber":2340,"name":"crypto socity","sponsor":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","tCdd":300000,"updater":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv"},{"desc":"密码学校欢迎你!","exited":1,"firstTime":"1610002234228","gid":"2222222200000000000000000001111111111111111333333333333333","lastTime":"1626522299821","lastTxid":"1111112200000000000000000001111111111111111333333333333333","memberNumber":102,"name":"crypto school","sponsor":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","tCdd":2300,"updater":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK"}],"height":989430,"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
    	"code": 4000,
    	"msg": "No matching record.",
    	"data": {
    		"signedRequest": "https://www.sign.cash/api/myGroupList?address=F888888888888888888888888888x&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000"
    	}
    }
    
    posted in Protocol/协议
  • FEIP28V2_Organization(zh-CN)
    FEIP28: Organization
    Version: 2
    Language: zh-CN
    Author: C_armX
    Status: testing
    Created date: 2021-12-06
    Last modified date:2021-12-10
    File hash: ""
    TXid: 
    

    FEIP28V2_Organization(zh-CN)

    Contents

    Introduction

    General rules of FEIP type protocols

    Rules specific to this protocol

    Create an organization

    Disband an organization

    Update organization consensus or description

    Accept the new consensus

    Invite members

    Join an organization

    Exit an organization

    Delist members

    Authorize

    Deauthorize

    Rate

    QR code

    Introduction

    Protocol type: FEIP
    Serial number: 28
    Protocol name: Organization
    Version: 2
    Description :  创建、管理和评价一个组织。
    Author: C_armX, Deisler-JJ_Sboy
    Language: en-US
    Tags: FEIP, organization, application protocol
    Previous version hash:""
    

    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 : JSON

    4. Encoding : utf-8

    Rules specific to this protocol

    1. 本协议用于在Freecash主链上创建、管理或评价一个组织。

    2. 任何FCH地址,可以声明创建一个组织,并发布组织的共识,该交易的txid即为组织身份,即:oid,创建这为该组织的所有者owner

    3. 组织的管理规则在共识中约定,共识文件做两次sha256哈希得到data.consHash的值。

    4. 只有owner可以解散组织更新共识或描述,共识更新后需要所有成员链上接受新共识

    5. owner可以转让组织给其他人,转让后被转让者成为该组织的owner

    6. owner可以依据《FEIP6_Master》声明自己的主控身份,该主控身份可以转让组织,以防止owner私钥泄露或丢失。

    7. owner或其授权的管理员可以向他人发出有时效的链上正式邀请,即邀请成员

    8. 被邀请者在邀请有效期内接受共识,同意加入组织,正式成为会员,未被邀请不能加入组织。

    9. 任何成员可以声明退出组织,owner管理员决定是否除名,相关权责变化由组织在共识中约定。

    10. owner可以授权特定成员为管理员,也可以解除授权

    11. 管理员必须为当前成员。管理员退出或被除名则自动失去管理员授权,需重新加入组织,并重新获得新的授权,才能恢复管理员身份。

    12. owner管理员可以除名组织成员

    13. 管理员可以除名自己。

    14. 为防范垃圾信息攻击,创建或更新组织至少应当销毁1000cd邀请、加入、授权至少应销毁10cd

    Create an organization

    发送一笔交易创建组织,并成为owner,销毁币天不小于1000。

    op_return内容为:

    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: 28 Y
    3 ver int 1 Fixed: 2 Y
    4 name String 4 Fixed: "Organization"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.op string 6 operation: "create" Y
    7 data.stdlName string 256 Name in english. N
    8 data.localName string array 1024 Names in different languages N
    9 data.consHash string 32 sha256 value of the organization consensus Y
    10 data.desc string 1-2048 Description of this organization Y
    • Example of creating an organization
    {
        "type": "FEIP",
        "sn": 28,
        "ver": 2,
        "name": "Organization",
        "hash": "",
        "data":{
            "op": "create",
            "stdName": "Love the earth"
            "localName": ["爱护地球","地球を愛する"]
            "consHash": "1111111111122222222223333333333333334444444445555555555666666",
            "desc": "This is a test Organization"
        }
    }
    

    Disband an organization

    由oid发送一笔交易,输出地址为本oid地址。
    op_return内容为:

    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: 28 Y
    3 ver int 1 Fixed: 2 Y
    4 name String 4 Fixed: "Organization"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.op string 7 operation: "disband" Y
    7 data.oid string 64 Organization ID Y
    • Example of disbanding an organization
    {
        "type": "FEIP",
        "sn": 28,
        "ver": 2,
        "name": "Organization",
        "hash": "",
        "data":{
            "op": "disband",
            "oid": "000000000000011111111111111"
        }
    }
    

    Update organization consensus or description

    由oid发送一笔交易,输入与输出均为本oid地址,销毁币天不小于1000。
    op_return内容为:

    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: 28 Y
    3 ver int 1 Fixed: 2 Y
    4 name String 4 Fixed: "Organization"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.op string 6 operation: "update" Y
    7 data.oid string 64 Organization ID Y
    8 data.stdlName string 256 Name in english. N
    9 data.localName string array 1024 Names in different languages N
    10 data.consHash string 32 sha256 value of the organization consensus Y
    11 data.desc string 1-2048 Description of this organization Y
    • Example of updating an organization
    {
        "type": "FEIP",
        "sn": 28,
        "ver": 2,
        "name": "Organization",
        "hash": "",
        "data":{
            "op": "update",
            "oid": "000000000000011111111111111",
            "localName": ["爱护地球","地球を愛する"]
            "consHash": "1111111111122222222223333333333333334444444445555555555666666",
            "desc": "New description for the test Organization"
        }
    }
    

    Accept the new consensus

    共识修改后,需要现有组织成员签名接受新共识。由组织成员给oid发送一笔交易,第一个输入为成员地址,第一个输出为所在oid地址。
    op_return内容为:

    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: 28 Y
    3 ver int 1 Fixed: 2 Y
    4 name String 4 Fixed: "Organization"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.op string 6 operation: "accept" Y
    7 data.oid string 64 Organization ID Y
    8 data.consHash string 32 the sha256 value of the new organization consensus Y
    9 data.consTxid string 32 the txid of updating consensus Y
    • Example of accepting new consensus
    {
        "type": "FEIP",
        "sn": 28,
        "ver": 2,
        "name": "Organization",
        "hash": "",
        "data":{
            "op": "accept",
            "oid": "000000000000011111111111111",
            "consHash": "1111111111122222222223333333333333334444444445555555555666666",
            "consTxid": "6666666666666666555555555444444444443333333333222222211111111"
        }
    }
    

    Invite members

    oid或管理员可向他人发出加入邀请。销毁币天不小于10cd。

    oid或被授权者发送一笔交易给被邀请者的地址。

    输出地址与addList一致,找零地址为第一个输入地址,输出金额不小于相应地址按《FEIP_NoticeFee》声明的noticeFee数额。

    op_return内容为:

    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: 28 Y
    3 ver int 1 Fixed: 2 Y
    4 name String 4 Fixed: "Organization"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.op string 3 operation: "add" Y
    7 data.oid string 64 Organization ID Y
    8 data.inviteList string array 1024 Addresses of the applicants. Y
    9 data.days int 2 Validity period of the invitation. Y
    • Example of adding members
    {
        "type": "FEIP",
        "sn": 28,
        "ver": 2,
        "name": "Organization",
        "hash": "",
        "data":{
            "op": "add",
            "oid": "000000000000011111111111111",
            "inviteList": [
    			"FCfcQA9VaCGNDoz3QqneMcFC8jTj3Cuuxc",
    			"FCG7ohMm8xZmhPEpE8Eni2ghiZT5ha9iJw",
    			"FFcY22BH2nyamDLdFWaDGwtKej9KdCKb51"
    		],
            "days": 10
        }
    }
    

    Join an organization

    主体收到邀请后,理解共识,并同意后发起交易,正式加入组织。销毁币天不小于10。

    接到邀请且同意加入,才正式成为组织成员,未接到邀请的加入操作无效。

    首输入为加入者地址,首输出为oid。

    op_return内容为:

    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: 28 Y
    3 ver int 1 Fixed: 2 Y
    4 name String 4 Fixed: "Organization"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.op string 6 operation: "join" Y
    7 data.oid string 64 Organization ID Y
    8 data.consHash string 32 the sha256 value of the new organization consensus Y
    • Example of accepting new consensus
    {
        "type": "FEIP",
        "sn": 28,
        "ver": 2,
        "name": "Organization",
        "hash": "",
        "data":{
            "op": "join",
            "oid": "000000000000011111111111111",
            "consHash": "1111111111122222222223333333333333334444444445555555555666666"
        }
    }
    

    Exit an organization

    由退出者发送一笔交易,第一个输入为退出者地址,第一个输出为想要退出的oid地址。

    op_return内容为:

    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: 28 Y
    3 ver int 1 Fixed: 2 Y
    4 name String 4 Fixed: "Organization"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.op string 4 operation: "exit" Y
    7 data.oid string 64 Organization ID Y
    • Example of appling to join in an organization
    {
        "type": "FEIP",
        "sn": 28,
        "ver": 2,
        "name": "Organization",
        "hash": "",
        "data":{
            "op": "exit",
            "oid": "000000000000011111111111111"
        }
    }
    

    Delist members

    oid或被授权者给被除名的所有地址发送交易。输出地址与deliList一致,找零地址为第一个输入地址。
    op_return内容为:

    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: 28 Y
    3 ver int 1 Fixed: 2 Y
    4 name String 4 Fixed: "Organization"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.op string 6 operation: "delist" Y
    7 data.oid string 64 Organization ID Y
    8 data.deliList string array 3096 Addresses to be delisted Y
    • Example of delist members
    {
        "type": "FEIP",
        "sn": 28,
        "ver": 2,
        "name": "Organization",
        "hash": "",
        "data":{
            "op": "delist",
            "oid": "000000000000011111111111111",
            "deliList": [
    			"FCfcQA9VaCGNDoz3QqneMcFC8jTj3Cuuxc",
    			"FCG7ohMm8xZmhPEpE8Eni2ghiZT5ha9iJw",
    			"FFcY22BH2nyamDLdFWaDGwtKej9KdCKb51"
    		]
        }
    }
    

    Authorize

    owner向若干成员发送交易,授权其代理执行指定操作。输出地址与AuthList一致,找零地址为第一个输入地址。销毁币天不小于10。

    op_return内容为:

    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: 28 Y
    3 ver int 1 Fixed: 2 Y
    4 name String 4 Fixed: "Organization"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.op string 10 operation: "authorize" Y
    7 data.oid string 64 Organization ID Y
    8 data.authList string array 2048 the list of addresses being authorized Y
    • Example of Authorize
    {
        "type": "FEIP",
        "sn": 28,
        "ver": 2,
        "name": "Organization",
        "hash": "",
        "data":{
            "op": "authorize",
            "oid": "000000000000011111111111111",
            "authList": [
    			"FCfcQA9VaCGNDoz3QqneMcFC8jTj3Cuuxc",
    			"FCG7ohMm8xZmhPEpE8Eni2ghiZT5ha9iJw",
    			"FFcY22BH2nyamDLdFWaDGwtKej9KdCKb51"
    		]
        }
    }
    

    Deauthorize

    owner向若干成员发送交易,取消对其所做的所有授权。输出地址与DeauList一致,找零地址为第一个输入地址。

    op_return内容为:

    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: 28 Y
    3 ver int 1 Fixed: 2 Y
    4 name String 4 Fixed: "Organization"<br>Case insensitive N
    5 hash hex 32 Sha256 value of this protocol file N
    6 data.op string 12 operation: "deauthorize" Y
    7 data.oid string 64 Organization ID Y
    8 data.deauList string array 2048 the list of addresses being deauthorized Y
    • Example of Deauthorize
    {
        "type": "FEIP",
        "sn": 28,
        "ver": 2,
        "name": "Organization",
        "hash": "",
        "data":{
            "op": "deauthorize",
            "oid": "000000000000011111111111111",
            "deauList": [
    			"FCfcQA9VaCGNDoz3QqneMcFC8jTj3Cuuxc",
    			"FCG7ohMm8xZmhPEpE8Eni2ghiZT5ha9iJw",
    			"FFcY22BH2nyamDLdFWaDGwtKej9KdCKb51"
    		]
        }
    }
    

    Rate

    评价者发送一笔交易评价某个组织。

    组织获得的所有评价按照币天销毁加权平均,得到该组织的综合评分。

    组织获得的所有评价的币天销毁总量可以用来衡量该组织的被关注度。

    op_return内容为:

    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: 28 Y
    3 ver int 1 Fixed: 2 Y
    4 name String 4 Fixed: "CAPP"<br>Case insensitive N
    5 hash hex 64 Sha256 value of this protocol file N
    6 data.oid hex 64 Txid when publishing the organization Y
    7 data.op string 7 operation: "rate" Y
    8 data.rate int 1 Rating of the service from 0 to 5 N

    Example of rate a CAPP

    {
        "type": "FEIP",
        "sn": 28,
        "ver": 2,
        "name": "Organization",
        "hash": "",
        "data":{
            "oid": "000000000000011111111111111",
            "op": "rate",
            "rate": 4
        }
    }
    

    QR code

    本协议的二维码用于传递组织名称与oid,包含以下内容:

    {
        "type": "FEIP",
        "sn": 28,
        "ver": 2,
        "data":{
            "stdName": "test",
            "oid": "000000000000011111111111111"
        }
    }
    
    posted in Protocol/协议
  • APIP8V1_EncryptedInfoOnChain(zh-CN)
    APIP8:EncryptedInfoOnChain
    Version:1
    Language:zh-CN
    Author:C_armX
    Status:draft
    Createddate:2021-12-01
    Update:2021-12-01
    Filehash:""
    TXid:
    

    APIP8V1_EncryptedInfoOnChain(zh-CN)


    目录

    关于APIP

    本协议的基本共识

    1.链上密信接口

    2.链上联系人接口

    3.链上保险柜接口


    Type:APIP
    SerialNumber:8
    ProtocolName:EncryptedInfoOnChain
    Version:1
    Description:定义密信、联系人、保险柜等链上加密信息接口。
    Author:C_armX
    Language:zh-CN
    tags:APIP,API, on-chain, mail, contact, safe, encrypted, op_return
    preVersionHash:""
    

    关于APIP

    1. APIP(Application Programming Interface Protocols)是自由共识生态协议的一种类型,用于创建开放的API文档,并且按照《FEIP1_FreeProtocol》协议发布在Freecash主链上。

    2. API的URL路径由服务方按照《FEIP29_Service》协议发布在Freecash主链上。

    3. APIP类型协议的一般共识在《APIP1_OpenAPI》中描述,包括接口标识、连接方式、请求方式、数据验证、常用参数、筛选与排序方式等。

    4. 按照《APIP1_OpenAPI》,API请求方向API服务方请求连接请求数据的流程概括如下:

      • 建立连接:请求方通过connect接口提交私钥签名,请求连接API服务,成功后获得对称密钥secretKey用于数据请求和验证。

      • 准备参数:请求数据时,在请求参数中加入timestamp,采用POST方法时,还需加入API的url

      • 参数排序:所有请求参数按字母升序排列,不区分大小写。

      • 数据签名:将secretKey追加至参数末尾,然后经两次sha256哈希获得签名sign

      • 发送请求:删除secretKey字段,将requestersign追加至末尾,发送给服务方。

      • 验证请求:API服务方验证requester授权、signtimestamp、POST方法url等均有效或正确后予以响应。

      • 响应数据:响应数据尾部加入secretKey后做两次sha256哈希获得sign,再用sign替换secretKey后将数据返回请求方。

      • 验证数据:请求方获得数据后,用secretKey替换sign后哈希签名,值与sign值一致则接受数据。

    本协议的基本共识

    1. 本协议接口提供密信、联系人、保险柜等链上加密信息。

    2. 本协议接口的数据来源遵循以下协议:

      • 《FEIP7_MailOnChain》
      • 《FEIP12_Contacts》
      • 《FEIP17_Safe》
    3. 本协议接口数据采用JSON格式。

    4. 示例数据:

    requester的地址:FEk41Kqjar45fLDriztUDTUkdki7mmcjWK
    
    requester的公钥:030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a
    
    requester的私钥:L2bHRej6Fxxipvb4TiR5bu1rkT3tRp8yWEsUy4R1Zb8VMm2x7sd8
    
    requester的secretKey:d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09
    
    apiURL:https://www.sign.cash/api/
    

    1.链上密信接口

    名称

    mailOnChain

    说明

    根据筛选条件获取链上密信信息。

    请求参数

    name type description required
    filterSender string Filter by the address of the first input. N
    filterRecipient string Filter by the address of the first output. N
    filterDeleted bool Filter by whether it has been deleted. 1 means it has been deleted. N
    filterAlg string Filter by encrypt algorithm. N
    filterTxTimestamp string Filter by the timestamp of the transaction N
    sortTxTimestamp string Sort by the timestamp of the transaction N
    sortDeleted string Filter by whether it has been deleted. N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批获取20封收件人为F99999999999999999999999xxxx的未删除密信,按时间倒序排列。

    参数

    {
    	"filterRecipinent": "F99999999999999999999999xxxx",
    	"filterDeleted": 0,
    	"sortTxTimestamp": "down",
        "count":20,
        "sequence":1
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/mailOnChain?count=20&filterDeleted=0&filterRecipinent=F99999999999999999999999xxxx&sequence=1&sortTxTimestamp=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/mailOnChain?aid=00000000000000000000000000111111111111111132222222222222&aid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=00000000000000000000011111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/mailOnChain?aid=00000000000000000000000000111111111111111132222222222222&aid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=00000000000000000000011111111111111111111111
    

    POST

    - URL:https://www.sign.cash/api/mailOnChain
    
    - unsignedRequest:
    
    {"count":20,"filterDeleted":0,"filterRecipinent":"F99999999999999999999999xxxx","sequence":1,"sortTxTimestamp":"down","timestamp":1635513688254,"url":"https://www.sign.cash/api/mailOnChain"}
    
    - sign =sha256(sha256({"count":20,"filterDeleted":0,"filterRecipinent":"F99999999999999999999999xxxx","sequence":1,"sortTxTimestamp":"down","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=0000000222223333333333355555555555
    
    - signedRequest:
    
    {"count":20,"filterDeleted":0,"filterRecipinent":"F99999999999999999999999xxxx","sequence":1,"sortTxTimestamp":"down","timestamp":1635513688254,"url":"https://www.sign.cash/api/mailOnChain","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"0000000222223333333333355555555555"}
    

    响应参数

    name type description
    mailList object See below.
    height uint The latest block height when getting the data.
    • mailList
    name type description key in FEIP7
    alg string The encrypt algorithm data.alg
    msgSend Mail encrypted with the public key of the sender data.msgSend
    msgReci Mail encrypted with the public key of the recipient data.msgReci
    sender string The address of the first input.
    recipient string The address of the first output.
    deleted bool Filter by whether it has been deleted. 1 means it has been deleted.
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例

    响应第2批获取20封收件人为F99999999999999999999999xxxx的未删除密信,按时间倒序排列。

    {
    	"mailList": [{
    			"alg": "ECC256k1-AES256CBC",
    			"msgSend": "Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=",
    			"msgReci": "Aooooooooooooooooooooooooooooooooo=",
    			"sender": "F1111111111111111111xxxx",
    			"recipient": "F99999999999999999999999xxxx",
    			"deleted": 0,
    			"txid": "022222222222222222222222222",
    			"txTimestamp": 1636526891,
    			"block": 923432
    		},
    		{
    			"alg": "ECC256k1-AES256CBC",
    			"msgSend": "Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr=",
    			"msgReci": "Asssssssssssssssssssssssssssssssss=",
    			"sender": "F222222222222222222222222xxxx",
    			"recipient": "F99999999999999999999999xxxx",
    			"deleted": 0,
    			"txid": "033333333333333333333333333333",
    			"txTimestamp": 1636834722,
    			"block": 902000
    		}
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"height":989430,"mailList":[{"alg":"ECC256k1-AES256CBC","block":923432,"deleted":0,"msgReci":"Aooooooooooooooooooooooooooooooooo=","msgSend":"Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=","recipient":"F99999999999999999999999xxxx","sender":"F1111111111111111111xxxx","txTimestamp":1636526891,"txid":"022222222222222222222222222"},{"alg":"ECC256k1-AES256CBC","block":902000,"deleted":0,"msgReci":"Asssssssssssssssssssssssssssssssss=","msgSend":"Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr=","recipient":"F99999999999999999999999xxxx","sender":"F222222222222222222222222xxxx","txTimestamp":1636834722,"txid":"033333333333333333333333333333"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
    	"code": 4000,
    	"msg": "No matching record.",
    	"data": {
    		"signedRequest": "https://www.sign.cash/api/mailOnChain?aid=00000000000000000000000000111111111111111132222222222222&aid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=00000000000000000000011111111111111111111111"
    	}
    }
    

    2.链上联系人接口

    名称

    contactsOnChain

    说明

    根据筛选条件获取链上联系人信息。

    请求参数

    name type description required
    filterHost string Filter by the host, the first address of the first output. N
    filterOperator string Filter by the operator,the first address of the first input. N
    filterDeleted bool Filter by whether it has been deleted. 1 means it has been deleted. N
    filterAlg string Filter by encrypt algorithm. N
    filterTxTimestamp string Filter by the timestamp of the transaction N
    sortTxTimestamp string Sort by the timestamp of the transaction N
    sortDeleted string Filter by whether it has been deleted. N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批获取20条由F99999999999999999999999xxxx为自己保存的未删除联系人信息,按时间倒序排列。

    参数

    {
    	"filterHost": "F99999999999999999999999xxxx",
    	"filterOperator": "F99999999999999999999999xxxx",
    	"filterDeleted": 0,
    	"sortTxTimestamp": "down",
        "count":20,
        "sequence":1
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/contactsOnChain?count=20&filterDeleted=0&filterHost=F99999999999999999999999xxxx&filterOperator=F99999999999999999999999xxxx&sequence=1&sortTxTimestamp=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/contactsOnChain?count=20&filterDeleted=0&filterHost=F99999999999999999999999xxxx&filterOperator=F99999999999999999999999xxxx&sequence=1&sortTxTimestamp=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=00000000000000000000011111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/contactsOnChain?count=20&filterDeleted=0&filterHost=F99999999999999999999999xxxx&filterOperator=F99999999999999999999999xxxx&sequence=1&sortTxTimestamp=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=00000000000000000000011111111111111111111111
    

    POST

    - URL:https://www.sign.cash/api/contactsOnChain
    
    - unsignedRequest:
    
    {"count":20,"filterDeleted":0,"filterHost":"F99999999999999999999999xxxx","filterOperator":"F99999999999999999999999xxxx","sequence":1,"sortTxTimestamp":"down","url":"https://www.sign.cash/api/contactsOnChain"}
    
    - sign =sha256(sha256({"count":20,"filterDeleted":0,"filterRecipinent":"F99999999999999999999999xxxx","sequence":1,"sortTxTimestamp":"down","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=0000000222223333333333355555555555
    
    - signedRequest:
    
    {"count":20,"filterDeleted":0,"filterHost":"F99999999999999999999999xxxx","filterOperator":"F99999999999999999999999xxxx","sequence":1,"sortTxTimestamp":"down","url":"https://www.sign.cash/api/contactsOnChain","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"0000000222223333333333355555555555"}
    

    响应参数

    name type description
    contactList object See below.
    height uint The latest block height when getting the data.
    • contactList
    name type description key in FEIP12
    alg string The encrypt algorithm data.alg
    msg Contact information encrypted with the public key of the host data.msg
    host string The host, the first address of the first output. N
    operator string The operator,the first address of the first input. N
    deleted bool Filter by whether it has been deleted. 1 means it has been deleted.
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例

    响应第2批获取20条由F99999999999999999999999xxxx为自己保存的未删除联系人信息,按时间倒序排列。

    {
    	"contactList": [{
    			"alg": "ECC256k1-AES256CBC",
    			"msg": "Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=",
    			"host": "F1111111111111111111xxxx",
    			"operator": "F99999999999999999999999xxxx",
    			"deleted": 0,
    			"txid": "022222222222222222222222222",
    			"txTimestamp": 1636526891,
    			"block": 923432
    		},
    		{
    			"alg": "ECC256k1-AES256CBC",
    			"msg": "Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr=",
    			"host": "F222222222222222222222222xxxx",
    			"operator": "F99999999999999999999999xxxx",
    			"deleted": 0,
    			"txid": "033333333333333333333333333333",
    			"txTimestamp": 1636834722,
    			"block": 902000
    		}
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    {"contactList":[{"alg":"ECC256k1-AES256CBC","block":923432,"deleted":0,"host":"F1111111111111111111xxxx","msg":"Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=","operator":"F99999999999999999999999xxxx","txTimestamp":1636526891,"txid":"022222222222222222222222222"},{"alg":"ECC256k1-AES256CBC","block":902000,"deleted":0,"host":"F222222222222222222222222xxxx","msg":"Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr=","operator":"F99999999999999999999999xxxx","txTimestamp":1636834722,"txid":"033333333333333333333333333333"}],"height":989430,"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
    	"code": 4000,
    	"msg": "No matching record.",
    	"data": {
    		"signedRequest": "https://www.sign.cash/api/contactsOnChain?count=20&filterDeleted=0&filterHost=F99999999999999999999999xxxx&filterOperator=F99999999999999999999999xxxx&sequence=1&sortTxTimestamp=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=00000000000000000000011111111111111111111111
    	}
    }
    

    3.链上保险柜接口

    名称

    safeOnChain

    说明

    根据筛选条件获取链上保险柜信息。

    请求参数

    name type description required
    filterHost string Filter by the host, the first address of the first output. N
    filterOperator string Filter by the operator,the first address of the first input. N
    filterDeleted bool Filter by whether it has been deleted. 1 means it has been deleted. N
    filterAlg string Filter by encrypt algorithm. N
    filterTxTimestamp string Filter by the timestamp of the transaction N
    sortTxTimestamp string Sort by the timestamp of the transaction N
    sortDeleted string Filter by whether it has been deleted. N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批获取20条由F99999999999999999999999xxxx为自己保存的未删除保险柜信息,按时间倒序排列。

    参数

    {
    	"filterHost": "F99999999999999999999999xxxx",
    	"filterOperator": "F99999999999999999999999xxxx",
    	"filterDeleted": 0,
    	"sortTxTimestamp": "down",
        "count":20,
        "sequence":1
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/safeOnChain?count=20&filterDeleted=0&filterHost=F99999999999999999999999xxxx&filterOperator=F99999999999999999999999xxxx&sequence=1&sortTxTimestamp=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/safeOnChain?count=20&filterDeleted=0&filterHost=F99999999999999999999999xxxx&filterOperator=F99999999999999999999999xxxx&sequence=1&sortTxTimestamp=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=00000000000000000000011111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/safeOnChain?count=20&filterDeleted=0&filterHost=F99999999999999999999999xxxx&filterOperator=F99999999999999999999999xxxx&sequence=1&sortTxTimestamp=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=00000000000000000000011111111111111111111111
    
    

    POST

    - URL:https://www.sign.cash/api/safeOnChain
    
    - unsignedRequest:
    
    {"count":20,"filterDeleted":0,"filterHost":"F99999999999999999999999xxxx","filterOperator":"F99999999999999999999999xxxx","sequence":1,"sortTxTimestamp":"down","url":"https://www.sign.cash/api/safeOnChain"}
    
    - sign =sha256(sha256({"count":20,"filterDeleted":0,"filterRecipinent":"F99999999999999999999999xxxx","sequence":1,"sortTxTimestamp":"down","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=0000000222223333333333355555555555
    
    - signedRequest:
    
    {"count":20,"filterDeleted":0,"filterHost":"F99999999999999999999999xxxx","filterOperator":"F99999999999999999999999xxxx","sequence":1,"sortTxTimestamp":"down","url":"https://www.sign.cash/api/safeOnChain","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"0000000222223333333333355555555555"}
    

    响应参数

    name type description
    safeList object See below.
    height uint The latest block height when getting the data.
    • safeList
    name type description key in FEIP17
    alg string The encrypt algorithm data.alg
    msg Safe entry information encrypted with the public key of the host data.msg
    host string The host, the first address of the first output. N
    operator string The operator,the first address of the first input. N
    deleted bool Filter by whether it has been deleted. 1 means it has been deleted.
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例

    响应第2批获取20条由F99999999999999999999999xxxx为自己保存的未删除保险柜条目信息,按时间倒序排列。

    {
    	"safeLsit": [{
    			"alg": "ECC256k1-AES256CBC",
    			"msg": "Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=",
    			"host": "F1111111111111111111xxxx",
    			"operator": "F99999999999999999999999xxxx",
    			"deleted": 0,
    			"txid": "022222222222222222222222222",
    			"txTimestamp": 1636526891,
    			"block": 923432
    		},
    		{
    			"alg": "ECC256k1-AES256CBC",
    			"msg": "Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr=",
    			"host": "F222222222222222222222222xxxx",
    			"operator": "F99999999999999999999999xxxx",
    			"deleted": 0,
    			"txid": "033333333333333333333333333333",
    			"txTimestamp": 1636834722,
    			"block": 902000
    		}
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"safeList":[{"alg":"ECC256k1-AES256CBC","block":923432,"deleted":0,"host":"F1111111111111111111xxxx","msg":"Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=","operator":"F99999999999999999999999xxxx","txTimestamp":1636526891,"txid":"022222222222222222222222222"},{"alg":"ECC256k1-AES256CBC","block":902000,"deleted":0,"host":"F222222222222222222222222xxxx","msg":"Arrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr=","operator":"F99999999999999999999999xxxx","txTimestamp":1636834722,"txid":"033333333333333333333333333333"}],"height":989430,"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
    	"code": 4000,
    	"msg": "No matching record.",
    	"data": {
    		"signedRequest": "https://www.sign.cash/api/safeOnChain?count=20&filterDeleted=0&filterHost=F99999999999999999999999xxxx&filterOperator=F99999999999999999999999xxxx&sequence=1&sortTxTimestamp=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=00000000000000000000011111111111111111111111"
    	}
    }
    
    posted in Protocol/协议
  • APIP7V1_CappInfo(zh-CN)
    APIP7:CappInfo
    Version:1
    Language:zh-CN
    Author:C_armX
    Status:draft
    Createddate:2021-12-01
    Update:2021-12-01
    Filehash:""
    TXid:
    

    #APIP7V1_CappInfo(zh-CN)

    ##目录

    关于APIP

    本协议的基本共识

    1.aid详情接口

    2.应用搜索接口

    3.应用历史接口

    4.应用评价列表接口


    Type:APIP
    SerialNumber:7
    ProtocolName:CappInfo
    Version:1
    Description:定义应用信息查询接口。
    Author:C_armX
    Language:zh-CN
    tags:APIP, API, capp, op_return
    preVersionHash:""
    

    关于APIP

    1. APIP(Application Programming Interface Protocols)是自由共识生态协议的一种类型,用于创建开放的API文档,并且按照《FEIP1_FreeProtocol》协议发布在Freecash主链上。

    2. API的URL路径由服务方按照《FEIP29_Service》协议发布在Freecash主链上。

    3. APIP类型协议的一般共识在《APIP1_OpenAPI》中描述,包括接口标识、连接方式、请求方式、数据验证、常用参数、筛选与排序方式等。

    4. 按照《APIP1_OpenAPI》,API请求方向API服务方请求连接请求数据的流程概括如下:

      • 建立连接:请求方通过connect接口提交私钥签名,请求连接API服务,成功后获得对称密钥secretKey用于数据请求和验证。

      • 准备参数:请求数据时,在请求参数中加入timestamp,采用POST方法时,还需加入API的url

      • 参数排序:所有请求参数按字母升序排列,不区分大小写。

      • 数据签名:将secretKey追加至参数末尾,然后经两次sha256哈希获得签名sign

      • 发送请求:删除secretKey字段,将requestersign追加至末尾,发送给服务方。

      • 验证请求:API服务方验证requester授权、signtimestamp、POST方法url等均有效或正确后予以响应。

      • 响应数据:响应数据尾部加入secretKey后做两次sha256哈希获得sign,再用sign替换secretKey后将数据返回请求方。

      • 验证数据:请求方获得数据后,用secretKey替换sign后哈希签名,值与sign值一致则接受数据。

    本协议的基本共识

    1. 本协议接口提供链上注册的各中密码应用的相关信息。

    2. 本协议接口的数据来源遵循以下协议:

      • 《FEIP15_CAPP》
    3. 本协议接口数据采用JSON格式。

    4. 示例数据:

    requester的地址:FEk41Kqjar45fLDriztUDTUkdki7mmcjWK
    
    requester的公钥:030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a
    
    requester的私钥:L2bHRej6Fxxipvb4TiR5bu1rkT3tRp8yWEsUy4R1Zb8VMm2x7sd8
    
    requester的secretKey:d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09
    
    apiURL:https://www.sign.cash/api/
    

    1.aid详情接口

    名称

    aidInfoList

    说明

    给定一个或多个aid获取相应应用详情。

    请求参数

    name type description
    aidList string array
    • 示例

    查询aid为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的应用最新详情。

    参数

    {
    	"aidList": ["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/aidInfoList?aid=00000000000000000000000000111111111111111132222222222222&aid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/aidInfoList?aid=00000000000000000000000000111111111111111132222222222222&aid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=33333333333335555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/aidInfoList?aid=00000000000000000000000000111111111111111132222222222222&aid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=33333333333335555555555522222222211111111111111111111111111111
    

    POST

    - URL:https://www.sign.cash/api/aidInfoList
    
    - unsignedRequest:
    
    {"aidList": ["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/aidInfoList"}
    
    - sign =sha256(sha256({"aidList":["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/aidInfoList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=555555555555555555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    {"aidList":["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/aidInfoList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"555555555555555555555555522222222211111111111111111111111111111"}
    

    响应参数

    name type description
    aidInfoList object See below.
    height uint The latest block height when getting the data.
    • aidInfoList
    name type description key in FEIP15
    aid string The ID of the capp,that is,the txid of the transaction in which the capp started up.
    stdName string The name of the capp in english data.stdName
    localName string array capp names in different languages data.localName
    desc string Description of this capp data.desc
    type string array The types of the capp data.type
    url string URL of the capp data.url
    prot string array The protocols followed by this CAPP data.prot
    serv string array The capps used by this CAPP data.serv
    pubKey string The public key designated by the publisher for this capp data.pubKey
    signer string The signer of the first input of the transaction in which the capp starts up.
    firstTime timeStamp The timeStamp of the transaction in which the capp was registered.
    lastTxid string The txid of the last operation of the capp.
    lastTime timeStamp The transaction timestamp of the last operation of the capp.
    tCdd uint64 The total destroyed coindays of all transactions where the value of data.op is "rate".
    tRate float Cumulative rating score. tRate=(tCdd*tRate+cdd*rate)/(tCdd+cdd)
    status bool Is the capp in effect.
    • 示例
      响应id为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的应用最新详情。
    {
    	"aidInfoList": [{
    			"aid": "000000001111111111111111111111122222222222222222222222222",
    			"stdName": "Free cid API",
    			"localName": ["免费cid信息接口"],
    			"desc": "提供cid的地址、公钥、homepage、通知费等详情信息",
    			"type": ["CID", "Basic API"],
    			"url": "https://www.sign.cash/cidInfo",
    			"prot": ["11111111111111111111111111", "22222222222222222222222"],
    			"serv": ["33333333333333333333333333", "44444444444444444444444"],
    			"pubKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTime": 1636526891,
    			"lastTxid": "1111112200000000000000000001111111111111111333333333333333",
    			"tCdd": 12300000,
    			"tRate": 4.65,
    			"status": 1
    		},
    
    
    		{
    			"aid": "2222222200000000000000000001111111111111111333333333333333",
    			"stdName": "Lianjia Housing agency",
    			"localName": "链家房屋中介",
    			"desc": "在世界各地提供优质的房屋中介应用。",
    			"type": ["House", "Agency"],
    			"url": "https://www.lianjia.com/index.html",
    			"prot": ["11111111111111111111111111", "22222222222222222222222"],
    			"serv": ["33333333333333333333333333", "44444444444444444444444"],
    			"pubKey": "000002020022222222222",
    			"signer": "F0000000000000008838dsjf",
    			"firstTime": 1619261292,
    			"lastTxid": "2222222200000000000000000001111111111111111333333333333333",
    			"lastTime": 1619261292,
    			"tCdd": 221800,
    			"tRate": 4.12,
    			"status": 1
    		}
    
    	],
    	"height": 989430
    }
    
    排序、压缩、签名后:
    
    {"aidInfoList":[{"aid":"000000001111111111111111111111122222222222222222222222222","desc":"提供cid的地址、公钥、homepage、通知费等详情信息","firstTime":1610261291,"lastTime":1636526891,"lastTxid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","localName":["免费cid信息接口"],"prot":["11111111111111111111111111","22222222222222222222222"],"pubKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","serv":["33333333333333333333333333","44444444444444444444444"],"signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"stdName":"Free cid API","tCdd":12300000,"tRate":4.65,"type":["Basic API","CID"],"url":"https://www.sign.cash/cidInfo"},{"aid":"2222222200000000000000000001111111111111111333333333333333","desc":"在世界各地提供优质的房屋中介应用。","firstTime":1619261292,"lastTime":1619261292,"lastTxid":"2222222200000000000000000001111111111111111333333333333333","localName":"链家房屋中介","prot":["11111111111111111111111111","22222222222222222222222"],"pubKey":"000002020022222222222","serv":["33333333333333333333333333","44444444444444444444444"],"signer":"F0000000000000008838dsjf","status":1,"stdName":"Lianjia Housing agency","tCdd":221800,"tRate":4.12,"type":["Agency","House"],"url":"https://www.lianjia.com/index.html"}],"height":989430,"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    7000 These AIDs do not exist. 这些AID不存在。 missedAidList
    7001 Too many AIDs are requested. 请求的AID数量太多。 maxAidCount
    • 示例
    {
    	"code": 7000,
    	"msg": "These AIDs do not exist.",
    	"data": {
    		"missedAidList": ["2222222200000000000000000001111111111111111333333333333333"]
    	}
    }
    

    2. 应用搜索接口

    名称

    cappSearch

    说明

    按条件查询应用。

    请求参数

    name type description required
    filterName string Filter by the stdName or localName N
    filterAddress string Filter by the designated address of the service,calculated from data.pubKey N
    filterType string Filter by the type of the capp N
    filterUrl string array Filter by URL N
    filterProt string The protocols followed by this CAPP data.prot
    filterServ string The capps used by this CAPP data.serv
    filterSigner string Filter by the signer N
    filterFirstTime string Filter by firstTime N
    filterLastTime string Filter by lastTime N
    filterTCdd string Filter by tCdd N
    filterTRate string Filter by tRate N
    filterStatus bool Sort by status N
    sortSigner string Sort by the signer N
    sortFirstTime string Sort by firstTime N
    sortLastTime string Sort by lastTime N
    sortTCdd string Sort by tCdd N
    sortTRate string Sort by tRate N
    sortStatus string Sort by status N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    查询2项类型为“API”,url含“sign.cash”,累计销毁币天tCdd大于1000的应用,结果按综合评分tRate排序。

    参数

    {
    	"filterType": "API",
    	"filterUrl": "sign.cash",
    	"filterTCdd": "1000-",
    	"sortTRate": "down",
    	"count": 2,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/cappSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/cappSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/cappSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/cappSearch
    
    - unsignedRequest:
    
    {"count":2,"filterTCdd":"1000-","filterType":"API","filterUrl":"sign.cash","sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/cappSearch"}
    
    - sign =sha256(sha256({"count":2,"filterTCdd":"1000-","filterType":"API","filterUrl":"sign.cash","sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/cappSearch","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":2,"filterTCdd":"1000-","filterType":"API","filterUrl":"sign.cash","sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/cappSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    cappList object See below.
    height uint The latest block height when getting the data.
    • cappList
    name type description key in FEIP15
    aid string The ID of the capp,that is,the txid of the transaction in which the capp started up.
    stdName string The name of the capp in english data.stdName
    localName string array capp names in different languages data.localName
    desc string Description of this capp data.desc
    type string array The types of the capp data.type
    url string URL of the capp data.url
    prot string array The protocols followed by this CAPP data.prot
    serv string array The capps used by this CAPP data.serv
    pubKey string The public key designated by the publisher for this capp data.pubKey
    signer string The signer of the first input of the transaction in which the capp starts up.
    firstTime timeStamp The timeStamp of the transaction in which the capp was registered.
    lastTxid string The txid of the last operation of the capp.
    lastTime timeStamp The transaction timestamp of the last operation of the capp.
    tCdd uint64 The total destroyed coindays of all transactions where the value of data.op is "rate".
    tRate float Cumulative rating score. tRate=(tCdd*tRate+cdd*rate)/(tCdd+cdd)
    status bool Is the capp in effect.
    • 示例

    响应查询2项类型为“API”,url含“sign.cash”,累计销毁币天tCdd大于1000的应用,结果按综合评分tRate排序。

    {
    	"aidInfoList": [{
    			"aid": "11111111111111111111111111111122222222222222222222222222",
    			"stdName": "Freesign",
    			"localName": ["飞签"],
    			"desc": "提供cid的地址、公钥、homepage、通知费等详情信息",
    			"type": ["sign", "Basic capp"],
    			"url": "https://www.sign.cash/cidInfo",
    			"prot": ["11111111111111111111111111", "22222222222222222222222"],
    			"serv": ["33333333333333333333333333", "44444444444444444444444"],
    			"pubKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTxid": "3333333333333333333333333333388888888888888888888888888889",
    			"lastTime": 1636526891,
    			"tCdd": 12300000,
    			"tRate": 4.65,
    			"status": 1
    		},
    
    
    		{
    			"aid": "22222222222222222222222222222222220000000000000000000000",
    			"stdName": "cryptosign",
    			"localName": ["密签"],
    			"desc": "提供协议的查询",
    			"type": ["AID", "capp", "Basic capp"],
    			"url": "https://www.sign.cash/pidInfo",
    			"prot": ["11111111111111111111111111", "22222222222222222222222"],
    			"serv": ["33333333333333333333333333", "44444444444444444444444"],
    			"pubKey": "03002320000000000000000000000000000000000000",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTxid": "133429999900000000000000000000000000",
    			"lastTime": 1636526891,
    			"tCdd": 300000,
    			"tRate": 4.32,
    			"status": 1
    		}
    
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    {"height":989430,"aidInfoList":[{"desc":"提供cid的地址、公钥、homepage、通知费等详情信息","firstTime":1610261291,"lastTime":1636526891,"lastTxid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","localName":["免费cid信息接口"],"prot":["11111111111111111111111111","22222222222222222222222"],"pubKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","serv":["33333333333333333333333333","44444444444444444444444"],"aid":"11111111111111111111111111111122222222222222222222222222","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"stdName":"Free cid API","tCdd":12300000,"tRate":4.65,"type":["Basic API","CID"],"url":"https://www.sign.cash/cidInfo"},{"desc":"提供协议的查询","firstTime":1610261291,"lastTime":1636526891,"lastTxid":"133429999900000000000000000000000000","localName":["协议信息接口"],"prot":["11111111111111111111111111","22222222222222222222222"],"pubKey":"03002320000000000000000000000000000000000000","serv":["33333333333333333333333333","44444444444444444444444"],"aid":"22222222222222222222222222222222220000000000000000000000","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"stdName":"protocol information API","tCdd":300000,"tRate":4.32,"type":["Basic API","PID","protocol"],"url":"https://www.sign.cash/pidInfo"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    signedRequest

    3. 应用历史接口

    名称

    aidHistory

    说明

    查询某aid应用的所有历史操作记录,不包括data.op值为“rate”的记录。

    请求参数

    name type description required
    aid string Y
    sortTxTimestamp string Sort by txTimestamp N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批查询20项aid为000000001111111111111111111111122222222222222222222222222的应用操作记录,按txTimestamp降序。

    参数

    {
    	"aid": "000000001111111111111111111111122222222222222222222222222",
        "sortTxTimestamp": "down",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/aidHistory?count=20&aid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortTxTimestamp=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/aidHistory?count=20&aid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortTxTimestamp=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/aidHistory?count=20&filteOp=rate&filterCdd=1000-&aid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/aidHistory
    
    - unsignedRequest:
    
    {"count":20,"aid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortTxTimestamp":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/aidHistory"}
    
    - sign =sha256(sha256({"count":20,"filteOp":"rate","filterCdd":"1000-","aid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/aidHistory","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":20,"filteOp":"rate","filterCdd":"1000-","aid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/aidHistory","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    aid string
    signer string The signer of the first input of the transaction in which the capp starts up.
    stdName string The recent name of the capp in english
    opList object See below.
    height uint The latest block height when getting the data.
    • opList
    name type description
    op string The operation, "start", "update", "stop", or "restart".
    stdName string The name of the capp in english
    localName string array capp names in different languages
    desc string Description of this capp
    type string array The types of the capp
    url string URL of the capp
    prot string array The protocols followed by this CAPP
    serv string array The capps used by this CAPP
    pubKey string The public key designated by the publisher for this capp
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例
      响应aid为000000001111111111111111111111122222222222222222222222222的应用信息。
    {
    	"aid": "000000001111111111111111111111122222222222222222222222222",
    	"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    	"stdName": "Freesign",
    	"aidInfoList": [{
    			"op": "stop",
    			"txTimestamp": 1613211239,
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"block": 989239
    		},
    
    		{
    			"op": "update",
    			"stdName": "Freesign",
    			"localName": ["飞签"],
    			"desc": "提供cid的地址、公钥、homepage、通知费等详情信息",
    			"type": ["CID", "Basic API"],
    			"url": "https://www.sign.cash/cidInfo",
    			"prot": ["11111111111111111111111111", "22222222222222222222222"],
    			"serv": ["33333333333333333333333333", "44444444444444444444444"],
    			"pubKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"txTimestamp": 1610261291,
    			"txid": "3333333333333333333333333333388888888888888888888888888889",
    			"block": 989021
    		}
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"aid":"000000001111111111111111111111122222222222222222222222222","aidInfoList":[{"block":989239,"op":"stop","txTimestamp":1613211239,"txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866"},{"block":989021,"desc":"提供cid的地址、公钥、homepage、通知费等详情信息","localName":["免费cid信息接口"],"op":"update","prot":["11111111111111111111111111","22222222222222222222222"],"pubKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","serv":["33333333333333333333333333","44444444444444444444444"],"stdName":"Free cid API","txTimestamp":1610261291,"txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","type":["Basic API","CID"],"url":"https://www.sign.cash/cidInfo"}],"height":989430,"signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","stdName":"Free cid API","sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    7002 The AID does not exist. 该AID不存在。 aid
    • 示例
    {
    	"code": 7002,
    	"msg": "The AID does not exist.",
    	"data": {
    		"aid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    

    4. 应用评价列表接口

    名称

    aidRateList

    说明

    查询对某aid应用的评价信息,即data.op值为“rate”的记录。

    请求参数

    name type description required
    aid string Y
    filterRate uint Filter by data.rate N
    filterCdd string Filter by cdd N
    filterTxTimestamp string Filter by txTimestamp N
    filterRater string Filter by the address of the first input of the rating transaction N
    sortTxTimestamp string Sort by txTimestamp N
    sortCdd string Sort by cdd N
    sortRate string Sort by data.rate N
    sortRater string Sort by the address of the first input of the rating transaction N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批查询20项aid为000000001111111111111111111111122222222222222222222222222的应用的币天销毁大于1000的评分记录,按评分降序。

    参数

    {
    	"aid": "000000001111111111111111111111122222222222222222222222222",
    	"filterCdd": "1000-",
    	"sortRate": "down",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/aidRateList?count=20&filterCdd=1000-&aid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/aidRateList?count=20&filterCdd=1000-&aid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111111110000000000000000000000222222
    
    - signedRequest:
    
    https://www.sign.cash/api/aidRateList?count=20&filterCdd=1000-&aid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000222222
    

    POST

    - URL:https://www.sign.cash/api/aidRateList
    
    - unsignedRequest:
    
    {"count":20,"filterCdd":"1000-","aid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/aidRateList"}
    
    - sign =sha256(sha256({"count":20,"filterCdd":"1000-","aid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/aidRateList","url":"https://www.sign.cash/api/aidRateList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":20,"filterCdd":"1000-","aid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/aidRateList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    aid string
    rateList object See below.
    height uint The latest block height when getting the data.
    • rateList
    name type description
    rater uint The address of the first input of the rating transaction
    rate uint
    cdd uint64
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例
      响应aid为000000001111111111111111111111122222222222222222222222222的应用信息。
    {
    	"aid": "000000001111111111111111111111122222222222222222222222222",
    	"rateList ": [{
    			"rater": "FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy",
    			"rate": 5,
    			"cdd": 3100,
    			"txid": "3333333333333333333333333333388888888888888888888888888889",
    			"txTimestamp": 1618832997321,
    			"block": 989302
    		},
    		{
    			"rater": "FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash",
    			"rate": 4,
    			"cdd": 10000,
    			"txid": "4444444333333333333333333333388888888888888888888888888889",
    			"txTimestamp": 1618834297302,
    			"block": 989302
    		}
    
    	],
    	"height": 989430
    }
    
    

    排序、压缩、签名后:

    
    {"aid":"000000001111111111111111111111122222222222222222222222222","height":989430,"rateList ":[{"block":989302,"cdd":3100,"rate":5,"rater":"FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy","txTimestamp":"1618832997321","txid":"3333333333333333333333333333388888888888888888888888888889"},{"block":989302,"cdd":10000,"rate":4,"rater":"FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash","txTimestamp":"1618834297302","txid":"4444444333333333333333333333388888888888888888888888888889"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    7002 The AID does not exist. 该AID不存在。 aid
    4000 No matching record. 没有符合条件的信息。 signedRequest
    • 示例
    {
    	"code": 7002,
    	"msg": "The AID does not exist.",
    	"data": {
    		"aid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    
    posted in Protocol/协议
  • APIP6V1_ServiceInfo(zh-CN)
    APIP6:ServiceInfo
    Version:1
    Language:zh-CN
    Author:C_armX
    Status:draft
    Createddate:2021-12-01
    Update:2021-12-01
    Filehash:""
    TXid:
    

    APIP6V1_ServiceInfo(zh-CN)


    目录

    关于APIP

    本协议的基本共识

    1.sid详情接口

    2.服务搜索接口

    3.服务历史接口

    4.服务评价列表接口


    Type:APIP
    SerialNumber:6
    ProtocolName:ServiceInfo
    Version:1
    Description:定义服务信息查询接口。
    Author:C_armX
    Language:zh-CN
    tags:APIP, API, service, op_return
    preVersionHash:""
    

    关于APIP

    1. APIP(Application Programming Interface Protocols)是自由共识生态协议的一种类型,用于创建开放的API文档,并且按照《FEIP1_FreeProtocol》协议发布在Freecash主链上。

    2. API的URL路径由服务方按照《FEIP29_Service》协议发布在Freecash主链上。

    3. APIP类型协议的一般共识在《APIP1_OpenAPI》中描述,包括接口标识、连接方式、请求方式、数据验证、常用参数、筛选与排序方式等。

    4. 按照《APIP1_OpenAPI》,API请求方向API服务方请求连接请求数据的流程概括如下:

      • 建立连接:请求方通过connect接口提交私钥签名,请求连接API服务,成功后获得对称密钥secretKey用于数据请求和验证。

      • 准备参数:请求数据时,在请求参数中加入timestamp,采用POST方法时,还需加入API的url

      • 参数排序:所有请求参数按字母升序排列,不区分大小写。

      • 数据签名:将secretKey追加至参数末尾,然后经两次sha256哈希获得签名sign

      • 发送请求:删除secretKey字段,将requestersign追加至末尾,发送给服务方。

      • 验证请求:API服务方验证requester授权、signtimestamp、POST方法url等均有效或正确后予以响应。

      • 响应数据:响应数据尾部加入secretKey后做两次sha256哈希获得sign,再用sign替换secretKey后将数据返回请求方。

      • 验证数据:请求方获得数据后,用secretKey替换sign后哈希签名,值与sign值一致则接受数据。

    本协议的基本共识

    1. 本协议接口提供链上注册的各项服务的相关信息。

    2. 本协议接口的数据来源遵循以下协议:

      • 《FEIP29_Service》
    3. 本协议接口数据采用JSON格式。

    4. 示例数据:

    requester的地址:FEk41Kqjar45fLDriztUDTUkdki7mmcjWK
    
    requester的公钥:030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a
    
    requester的私钥:L2bHRej6Fxxipvb4TiR5bu1rkT3tRp8yWEsUy4R1Zb8VMm2x7sd8
    
    requester的secretKey:d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09
    
    apiURL:https://www.sign.cash/api/
    

    1.sid详情接口

    名称

    sidInfoList

    说明

    给定一个或多个sid获取相应服务详情。

    请求参数

    name type description
    sidList string array

    *示例

    查询sid为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的服务最新详情。

    参数

    {
    	"sidList": ["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/sidInfoList?sid=00000000000000000000000000111111111111111132222222222222&sid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/sidInfoList?sid=00000000000000000000000000111111111111111132222222222222&sid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=33333333333335555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    https://www.sign.cash/api/sidInfoList?sid=00000000000000000000000000111111111111111132222222222222&sid=2222222200000000000000000001111111111111111333333333333333&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=33333333333335555555555522222222211111111111111111111111111111
    

    POST

    - URL:https://www.sign.cash/api/sidInfoList
    
    - unsignedRequest:
    
    {"sidList": ["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/sidInfoList"}
    
    - sign =sha256(sha256({"sidList":["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/sidInfoList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=555555555555555555555555522222222211111111111111111111111111111
    
    - signedRequest:
    
    {"sidList":["00000000000000000000000000111111111111111132222222222222","2222222200000000000000000001111111111111111333333333333333"],"timestamp":1635513688254,"url":"https://www.sign.cash/api/sidInfoList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"555555555555555555555555522222222211111111111111111111111111111"}
    

    响应参数

    name type description
    sidInfoList object See below.
    height uint The latest block height when getting the data.
    • sidInfoList
    name type description key in FEIP29
    sid string The ID of the service,that is,the txid of the transaction in which the service started up.
    stdName string The name of the service in english data.stdName
    localName string array Service names in different languages data.localName
    desc string Description of this service data.desc
    type string array The types of the service data.type
    url string URL of the service data.url
    pubKey string The public key designated by the publisher for this service data.pubKey
    signer string The signer of the first input of the transaction in which the service starts up.
    firstTime timeStamp The timeStamp of the transaction in which the service started up.
    lastTxid string The txid of the last operation of the service.
    lastTime timeStamp The transaction timestamp of the last operation of the service.
    tCdd uint64 The total destroyed coindays of all transactions where the value of data.op is "rate".
    tRate float Cumulative rating score. tRate=(tCdd*tRate+cdd*rate)/(tCdd+cdd)
    status bool Is the service in effect.
    • 示例
      响应id为00000000000000000000000000111111111111111132222222222222和2222222200000000000000000001111111111111111333333333333333的服务最新详情。
    {
    	"sidInfoList": [{
    			"sid": "000000001111111111111111111111122222222222222222222222222",
    			"stdName": "Free cid API",
    			"localName": ["免费cid信息接口"],
    			"desc": "提供cid的地址、公钥、homepage、通知费等详情信息",
    			"type": ["CID", "Basic API"],
    			"url": "https://www.sign.cash/cidInfo",
    			"pubKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTxid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"lastTime": 1636526891,
    			"tCdd": 12300000,
    			"tRate": 4.65,
    			"status": 1
    		},
    
    
    		{
    			"sid": "2222222200000000000000000001111111111111111333333333333333",
    			"stdName": "Lianjia Housing agency",
    			"localName": "链家房屋中介",
    			"desc": "在世界各地提供优质的房屋中介服务。",
    			"type": ["House", "Agency"],
    			"url": "https://www.lianjia.com/index.html",
    			"pubKey": "000002020022222222222",
    			"signer": "F0000000000000008838dsjf",
    			"firstTime": 1619261292,
    			"lastTxid": "2222222200000000000000000001111111111111111333333333333333",
    			"lastTime": 1619261292,
    			"tCdd": 221800,
    			"tRate": 4.12,
    			"status": 1
    		}
    
    	],
    	"height": 989430
    }
    
    排序、压缩、签名后:
    
    {"height":989430,"sidInfoList":[{"desc":"提供cid的地址、公钥、homepage、通知费等详情信息","firstTime":1610261291,"lastTime":1636526891,"lastTxid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","localName":["免费cid信息接口"],"pubKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","sid":"000000001111111111111111111111122222222222222222222222222","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"stdName":"Free cid API","tCdd":12300000,"tRate":4.65,"type":["Basic API","CID"],"url":"https://www.sign.cash/cidInfo"},{"desc":"在世界各地提供优质的房屋中介服务。","firstTime":1619261292,"lastTime":1619261292,"lastTxid":"2222222200000000000000000001111111111111111333333333333333","localName":"链家房屋中介","pubKey":"000002020022222222222","sid":"2222222200000000000000000001111111111111111333333333333333","signer":"F0000000000000008838dsjf","status":1,"stdName":"Lianjia Housing agency","tCdd":221800,"tRate":4.12,"type":["Agency","House"],"url":"https://www.lianjia.com/index.html"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    6000 These SIDs do not exist. 这些SID不存在。 missedSidList
    6001 Too many SIDs are requested. 请求的SID数量太多。 maxSidCount
    • 示例
    {
    	"code": 6000,
    	"msg": "These SIDs do not exist.",
    	"data": {
    		"missedSidList": ["2222222200000000000000000001111111111111111333333333333333"]
    	}
    }
    

    2. 服务搜索接口

    名称

    serviceSearch

    说明

    按条件查询服务。

    请求参数

    name type description required
    filterName string Filter by the stdName or localName N
    filterAddress string Filter by the designated address of the service,calculated from data.pubKey N
    filterType string Filter by the type of the service N
    filterUrl string Filter by URL N
    filterSigner string Filter by the signer N
    filterFirstTime string Filter by firstTime N
    filterLastTime string Filter by lastTime N
    filterTCdd string Filter by tCdd N
    filterTRate string Filter by tRate N
    filterStatus bool Sort by status N
    sortSigner string Sort by the signer N
    sortFirstTime string Sort by firstTime N
    sortLastTime string Sort by lastTime N
    sortTCdd string Sort by tCdd N
    sortTRate string Sort by tRate N
    sortStatus string Sort by status N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    查询2项类型为“API”,url含“sign.cash”,累计销毁币天tCdd大于1000的服务,结果按综合评分tRate排序。

    参数

    {
    	"filterType": "API",
    	"filterUrl": "sign.cash",
    	"filterTCdd": "1000-",
    	"sortTRate": "down",
    	"count": 2,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/serviceSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/serviceSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/serviceSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/serviceSearch
    
    - unsignedRequest:
    
    {"count":2,"filterTCdd":"1000-","filterType":"API","filterUrl":"sign.cash","sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/serviceSearch"}
    
    - sign =sha256(sha256({"count":2,"filterTCdd":"1000-","filterType":"API","filterUrl":"sign.cash","sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/serviceSearch","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":2,"filterTCdd":"1000-","filterType":"API","filterUrl":"sign.cash","sortTRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/serviceSearch","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    serviceList object See below.
    height uint The latest block height when getting the data.
    • serviceList
    name type description key in FEIP29
    sid string The ID of the service,that is,the txid of the transaction in which the service started up.
    stdName string The name of the service in english data.stdName
    localName string array Service names in different languages data.localName
    desc string Description of this service data.desc
    type string array The types of the service data.type
    url string URL of the service data.url
    pubKey string The public key designated by the publisher for this service data.pubKey
    signer string The signer of the first input of the transaction in which the service starts up.
    firstTime timeStamp The timeStamp of the transaction in which the service started up.
    lastTxid string The txid of the last operation of the service.
    lastTime timeStamp The transaction timestamp of the last operation of the service.
    tCdd uint64 The total destroyed coindays of all transactions where the value of data.op is "rate".
    tRate float Cumulative rating score. tRate=(tCdd*tRate+cdd*rate)/(tCdd+cdd)
    status bool Is the service in effect.
    • 示例

    响应查询2项类型为“API”,url含“sign.cash”,累计销毁币天tCdd大于1000的服务,结果按综合评分tRate排序。

    {
    	"sidInfoList": [{
    			"sid": "11111111111111111111111111111122222222222222222222222222",
    			"stdName": "Free cid API",
    			"localName": ["免费cid信息接口"],
    			"desc": "提供cid的地址、公钥、homepage、通知费等详情信息",
    			"type": ["CID", "Basic API"],
    			"url": "https://www.sign.cash/cidInfo",
    			"pubKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTxid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"lastTime": 1636526891,
    			"tCdd": 12300000,
    			"tRate": 4.65,
    			"status": 1
    		},
    
    
    		{
    			"sid": "22222222222222222222222222222222220000000000000000000000",
    			"stdName": "protocol information API",
    			"localName": ["协议信息接口"],
    			"desc": "提供协议的查询",
    			"type": ["PID", "protocol", "Basic API"],
    			"url": "https://www.sign.cash/pidInfo",
    			"pubKey": "03002320000000000000000000000000000000000000",
    			"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    			"firstTime": 1610261291,
    			"lastTxid": "133429999900000000000000000000000000",
    			"lastTime": 1636526891,
    			"tCdd": 300000,
    			"tRate": 4.32,
    			"status": 1
    		}
    
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    {"height":989430,"sidInfoList":[{"desc":"提供cid的地址、公钥、homepage、通知费等详情信息","firstTime":1610261291,"lastTime":1636526891,"lastTxid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","localName":["免费cid信息接口"],"pubKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","sid":"11111111111111111111111111111122222222222222222222222222","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"stdName":"Free cid API","tCdd":12300000,"tRate":4.65,"type":["Basic API","CID"],"url":"https://www.sign.cash/cidInfo"},{"desc":"提供协议的查询","firstTime":1610261291,"lastTime":1636526891,"lastTxid":"133429999900000000000000000000000000","localName":["协议信息接口"],"pubKey":"03002320000000000000000000000000000000000000","sid":"22222222222222222222222222222222220000000000000000000000","signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","status":1,"stdName":"protocol information API","tCdd":300000,"tRate":4.32,"type":["Basic API","PID","protocol"],"url":"https://www.sign.cash/pidInfo"}],"sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    4000 No matching record. 没有符合条件的信息。 signedRequest

    *示例

    {
    	"code": 4000,
    	"msg": "No matching record.",
    	"data": {
    		"signedRequest": "https://www.sign.cash/api/serviceSearch?count=2&filterTCdd=1000-&filterType=API&filterUrl=sign.cash&sortTRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000"
    	}
    }
    

    3. 服务历史接口

    名称

    sidHistory

    说明

    查询某sid服务的所有历史操作记录,不包括data.op值为“rate”的记录。

    请求参数

    name type description required
    sid string Y
    sortTxTimestamp string Sort by txTimestamp N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批查询20项sid为000000001111111111111111111111122222222222222222222222222的服务操作记录,按txTimestamp降序。

    参数

    {
    	"sid": "000000001111111111111111111111122222222222222222222222222",
        "sortTxTimestamp": "down",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/sidHistory?count=20&sid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortTxTimestamp=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/sidHistory?count=20&sid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortTxTimestamp=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111110000000000000000000000
    
    - signedRequest:
    
    https://www.sign.cash/api/sidHistory?count=20&filteOp=rate&filterCdd=1000-&sid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000
    

    POST

    - URL:https://www.sign.cash/api/sidHistory
    
    - unsignedRequest:
    
    {"count":20,"sid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortTxTimestamp":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/sidHistory"}
    
    - sign =sha256(sha256({"count":20,"filteOp":"rate","filterCdd":"1000-","sid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/sidHistory","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":20,"filteOp":"rate","filterCdd":"1000-","sid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/sidHistory","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    sid string
    signer string The signer of the first input of the transaction in which the service starts up.
    stdName string The recent name of the service in english
    opList object See below.
    height uint The latest block height when getting the data.
    • opList
    name type description
    op string The operation, "start", "update", "stop", or "restart".
    stdName string The name of the service in english
    localName string array Service names in different languages
    desc string Description of this service
    type string array The types of the service
    url string URL of the service
    pubKey string The public key designated by the publisher for this service
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例
      响应sid为000000001111111111111111111111122222222222222222222222222的服务信息。
    {
    	"sid": "000000001111111111111111111111122222222222222222222222222",
    	"signer": "FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv",
    	"stdName": "Free cid API",
    	"sidInfoList": [{
    			"op": "stop",
    			"txTimestamp": 1613211239,
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"block": 989239
    		},
    
    		{
    			"op": "update",
    			"stdName": "Free cid API",
    			"localName": ["免费cid信息接口"],
    			"desc": "提供cid的地址、公钥、homepage、通知费等详情信息",
    			"type": ["CID", "Basic API"],
    			"url": "https://www.sign.cash/cidInfo",
    			"pubKey": "030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a",
    			"txTimestamp": 1610261291,
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"block": 989021
    		}
    	],
    	"height": 989430
    }
    

    排序、压缩、签名后:

    
    {"height":989430,"sid":"000000001111111111111111111111122222222222222222222222222","sidInfoList":[{"block":989239,"op":"stop","txTimestamp":1613211239,"txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866"},{"block":989021,"desc":"提供cid的地址、公钥、homepage、通知费等详情信息","localName":["免费cid信息接口"],"op":"update","pubKey":"030be1d7e633feb2338a74a860e76d893bac525f35a5813cb7b21e27ba1bc8312a","stdName":"Free cid API","txTimestamp":1610261291,"txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866","type":["Basic API","CID"],"url":"https://www.sign.cash/cidInfo"}],"signer":"FPL44YJRwPdd2ipziFvqq6y2tw4VnVvpAv","stdName":"Free cid API","sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    6002 The SID does not exist. 该SID不存在。 sid

    *示例

    {
    	"code": 6002,
    	"msg": "The SID does not exist.",
    	"data": {
    		"sid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    

    4. 服务评价列表接口

    名称

    sidRateList

    说明

    查询对某sid服务的评价信息,即data.op值为“rate”的记录。

    请求参数

    name type description required
    sid string Y
    filterRate string Filter by data.rate N
    filterCdd string Filter by cdd N
    filterTxTimestamp string Filter by txTimestamp N
    filterRater string Filter by the address of the first input of the rating transaction N
    sortTxTimestamp string Sort by txTimestamp N
    sortCdd string Sort by cdd N
    sortRate string Sort by data.rate N
    sortRater string Sort by the address of the first input of the rating transaction N
    count uint How many entries are wanted in a single request. N
    sequence uint Sequence in continuous request.Start from 0. N
    • 示例

    第2批查询20项sid为000000001111111111111111111111122222222222222222222222222的服务的币天销毁大于1000的评分记录,按评分降序。

    参数

    {
    	"sid": "000000001111111111111111111111122222222222222222222222222",
    	"filterCdd": "1000-",
    	"sortRate": "down",
    	"count": 20,
    	"sequence": 1,
    	"timestamp": 1635513688254
    }
    

    GET

    - unsignedRequest:
    
    https://www.sign.cash/api/sidRateList?count=20&filterCdd=1000-&sid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254
    
    - sign =sha256(sha256(https://www.sign.cash/api/sidRateList?count=20&filterCdd=1000-&sid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&secretKey=d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09))=1111111111111111110000000000000000000000222222
    
    - signedRequest:
    
    https://www.sign.cash/api/sidRateList?count=20&filterCdd=1000-&sid=000000001111111111111111111111122222222222222222222222222&sequence=1&sortRate=down&timestamp=1635513688254&requester=FEk41Kqjar45fLDriztUDTUkdki7mmcjWK&sign=1111111111111111110000000000000000000000222222
    

    POST

    - URL:https://www.sign.cash/api/sidRateList
    
    - unsignedRequest:
    
    {"count":20,"filterCdd":"1000-","sid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/sidRateList"}
    
    - sign =sha256(sha256({"count":20,"filterCdd":"1000-","sid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/sidRateList","url":"https://www.sign.cash/api/sidRateList","secretKey":"d2c03bbc1ba1380eafc395374e8da61f92545a1aac5d30b0c19289a69bd34a09"}))=1111111111111111110000000000000000000000
    
    - signedRequest:
    
    {"count":20,"filterCdd":"1000-","sid":"000000001111111111111111111111122222222222222222222222222","sequence":1,"sortRate":"down","timestamp":"1635513688254","url":"https://www.sign.cash/api/sidRateList","requester":"FEk41Kqjar45fLDriztUDTUkdki7mmcjWK","sign":"1111111111111111110000000000000000000000"}
    

    响应参数

    name type description
    sid string
    rateList object See below.
    height uint The latest block height when getting the data.
    • rateList
    name type description
    rater uint The address of the first input of the rating transaction
    rate uint
    cdd uint64
    txid string The txid of this transaction
    txTimestamp timestamp The timestamp of this transaction
    block uint The height of the block where the transaction is written
    • 示例
      响应sid为000000001111111111111111111111122222222222222222222222222的服务信息。
    {
    	"sid": "000000001111111111111111111111122222222222222222222222222",
    	"rateList ": [{
    			"rater": "FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy",
    			"rate": 5,
    			"cdd": 3100,
    			"txid": "0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866",
    			"txTimestamp": 1618832997321,
    			"block": 989302
    		},
    		{
    			"rater": "FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash",
    			"rate": 4,
    			"cdd": 10000,
    			"txid": "dde54b27326c11236676dfd5b3c030539a72e39924e7ad835b70ff16a5647715",
    			"txTimestamp": 1618834297302,
    			"block": 989302
    		}
    
    	],
    	"height": 989430
    }
    
    

    排序、压缩、签名后:

    
    {"height":989430,"rateList ":[{"block":989302,"cdd":3100,"rate":5,"rater":"FS2AWq1dgdhCpNTwqfBbMBBJGNNj1LSboy","txTimestamp":"1618832997321","txid":"0460fc1a1ada6479037a07c05509cfcb0d2e8ead2d2b32a5a6784f558c448866"},{"block":989302,"cdd":10000,"rate":4,"rater":"FLx88wdsbLQyZRmbqtpeXA9u5FG9EyCash","txTimestamp":"1618834297302","txid":"dde54b27326c11236676dfd5b3c030539a72e39924e7ad835b70ff16a5647715"}],"sid":"000000001111111111111111111111122222222222222222222222222","sign":"00000000000000000000011111111111111111111111"}
    
    

    返回值

    返回值 类型 必填 说明
    code uint Y 返回码
    msg string Y 返回信息
    data object N 相关数据
    • 返回信息详情
    code msg 说明 data字段
    0 OK 请求成功
    1 Unknown error. 未知错误 signedRequest
    6002 The SID does not exist. 该SID不存在。 sid
    4000 No matching record. 没有符合条件的信息。 signedRequest

    *示例

    {
    	"code": 6002,
    	"msg": "The SID does not exist.",
    	"data": {
    		"sid": "000000001111111111111111111111122222222222222222222222222"
    	}
    }
    
    posted in Protocol/协议
  • 《AES-ECC加解密任务》招标任务开发完成,交付>>>

    1月24日,《AES-ECC加解密任务》招标任务开发完成,交付了1)AES-ECC协议文档,2)AES-ECC接口文档,3)Java源码和4)JS源码。此任务解决了密码经济开发缺乏一致的Java与JS通用文件加解密工具的瓶颈,标志着自由共识生态构建的技术底层基本完备。https://bbs.cash/topic/614/

    posted in Announcements & News/公告