This is a common flow of eywa.
- User register : User register to eywa chain network with public key.
After user register, user can use eywa service as two way. We assume that alice and bob are registered.
Alice want to send message to bob.
- Alice create handshake : Alice create handshake which contain the bob wallet address
- Alice Download Bob public key : As same time Alice download Bob public key from eywa chain network.
- Bob watch handshake : Bob watch handshake which contain the bob wallet address
- Bob Download Alice public key : When detect handshake, Bob download Alice public key from eywa chain network.
- Alice create chat message : Alice create chat message which contain the bob wallet address, encrypted message with Bob public key, message time
- Bob watch chat message : Bob watch chat message which contain the bob wallet address, encrypted message, message time
- Bob decrypt message : Bob decrypt message with Bob private key
- Bob create chat message : Bob create chat message which contain the alice wallet address, encrypted message with Alice public key, message time
- Alice watch chat message : Alice watch chat message which contain the alice wallet address, encrypted message, message time
Alice want to send message to bob.
-
Alice create handshake : Alice create handshake which contain the bob wallet address, server address, chat room id
-
Alice Download Bob public key : As same time Alice download Bob public key from eywa chain network.
-
Alice Create chat room : Alice create chat room with room id and access socket server.
-
Bob watch handshake : Bob watch handshake which contain the bob wallet address, server address, chat room id
-
Bob Download Alice public key : When detect handshake, Bob download Alice public key from eywa chain network.
-
Bob Access chat room : Bob access chat room with room id and access socket server.
-
Alice create chat message : Alice create chat message to chat room (which use the socket server)
-
Bob create chat message : Bob create chat message to chat room (which use the socket server)
-
Backup the chat message to eywa chain network : The backup of encrypted services is regularly taken from the socket server to the eywa chain.
eywad tx eywa register-user [PubKey] --from alice
- PubKey : User public key
eywad q eywa get-user [Address]
- Address : USer wallet address
eywad tx eywa create-handshake [Receiver] [RoomId] [ServerAddress] --from alice
- Receiver : Receiver wallet address
- RoomId : Chat Room Id
- ServerAddress : Server Address (ip , domain)
eywad q eywa get-handshake [Receiver]
- Receiver : Receiver wallet address
eywad tx eywa create-relay-server [Nickname] [Location] --from alice
- Nickname : Relay Server nickname
- Location : Relay Server ip (ip , domain)
eywad q eywa get-relay-server-all
eywad tx eywa create-chat-room [RoomId] [Receiver] [Message] [Time] --from alice
- RoomId : Chat Room Id
- Receiver : Receiver wallet address
- Message : encrypted message
- Time : message time
eywad q eywa get-chat-room [RoomId]
- RoomId : Chat Room Id