FIPA8V1_LogInByIP
-
FIPA8: LogInByIP Version: 1 Language: en-US Author: C_armX Status: draft Created date: 2021-10-01 Last modified date:2021-10-01 File hash: unknown Txid: Unpublished
FIPA8V1_LogInByIP
contents
General rules of FIPA protocols
Rules specific to this protocol
Introduction
Protocol type: FIPA Serial number: 8 Protocol name: LogInByIP Version: 1 Description : One-way login without interaction by signing the request IP. Author: C_armX Language: en-US Tags: FIPA, login,IP PreVersion hash:
General rules of FIPA protocols
FIPA protocols regulate improvements that do not require a hard fork upgrade of the main network, and do not determine the structure of the data written in the Distributed storage system.
Rules specific to this protocol
-
This agreement provides a way for user to sign an IP with a private key to allow logging in to the specified APP from that IP.
-
The APPs logged in in this way use the fch address as the user identity or account. When logging in, the address used to sign is the same as the login address.
-
The IP can be the current device IP or other IP authorized to log in by the user.
-
The ID of the APP refers to the txid when the app is registered on the chain according to the protocol "FEIP15_CAPP", that is, the AID of the APP to log in.
-
When signing, the value of message is compressed in json format with braces.
Login process
Data Format
field number field name type length content required 1 type String 4 Fixed: "FIPA"<br>Case insensitive Y 2 sn int 1 Serial number<br>Fixed: 8 Y 3 ver int 1 Fixed: 1 Y 4 name String 9 Fixed: "LogInByIP"<br>Case insensitive N 5 hash hex 32 Sha256 value of this protocol file N 6 message.IP string 15 IP of requesting for login Y 7 message.AID string 32 The AID of the APP to log in Y 8 message.timestamp timestamp 10 the time of signing Y 9 address string 34 the address logging in Y 10 signature string 93 signature of “message” signed by the private key of “address” Y Json example
{ "type": "FIPA", "sn": 8, "ver": 1, "name": "LogInByIP", "hash": "", "message":{ "IP": "119.102.1.122", "AID": "1cf960e0cf914bf7d19565d304a61a1123600e49eeb12f2fb7988c83cba18bb0", "timestamp": 1435113975 }, "address": "FEk41Kqjar45fLDriztUDTUkdki7mmcjWK", "signature": "H7PyP5Vc8TcjZgetU0WuqV0E+o+VudwOGODf4BTmUrlZFKWMZwckHnukiZYNrqKvMcZf9PtyfC9NAHtu3tvBWi4\u003d" }
The message to be signed is:
{"IP":"119.102.1.122","AID":"1cf960e0cf914bf7d19565d304a61a1123600e49eeb12f2fb7988c83cba18bb0","timestamp":1435113975}
Return data
Data format
name type errorCode int errorMessage string Error detail
errorCode errorMessage 0 Success 200 Request for signature timed out. 201 The signature failed verification. 202 The signer was denied access. Json example
{ "errorCode":200, "errorMessage":"Request for signature timed out." }
-