With the new feature “Authenticated Anonymity“ CodeB addresses the need for authenticated but anonymous communication.
Required function as not only exposed in the messaging namespace of our Web Services Interfaces but are also abstracted into our CommandLine Interface.
To send an anonymous message at least three parties (Self-Sovereign Identities) are involved.
- Sender SSI
- Recipient SSI
- Group SSI responsible to distribute Zero-Knowledge authentication keys.
Create ZKP exchange keys
Sender and Recipient need to create keys with they only use of exchanging the ZKP keys with the the Group SSI. To do so both need to call the following:
c:\> codeb_cli.exe keys -a createregister -c <principal account address of SSI> -p <principal account password>
You should store the output of the command at a secure place:
Address created: 0xfeee980183EC6dA8b6c55a8C1b3ea899624117BF
Mnemonic Phrase:
history melody music clever federal fence memory able clay uncover salt skate
Server Password: 11de11e62c40068a4c33d73778b88
Distribution of ZKP material via Group SSI
To be able for the Group SSI to exchange the required ZKP material the the above created ZKP exchange keys need to be registered with a virtual group inside the Group SSI. Group IDs can range from 0-9999. For example they could be a country prefix.
c:\> codeb_cli.exe group -a add -i <groupid> -c <principal account address of group ssi> -p <password group ssi’s principal account> -g <address of group ssi> -m <members ssi address> -e <optional members name or comment>
Once a next blockchain block has been confirmed you can trigger the command to distribute the ZKP material to the group members.
c:\> codeb_cli.exe group -a updatezkps -i <groupid> -g <address of group ssi> -c <principal account of group ssi> -p <password of group ssi’s principal account>
Again it is advised to wait for a new block to be mined before proceeding with sending messages.
Create unregistered keys
To remain anonymous it is required to use unregistered keys to encrypt the messages. The amount of unregistered keys is not limited so that they can be used once and thrown away.
c:\> codeb_cli.exe keys -a create -c <principal account address of SSI> -p <principal account password>
Again it is important you take note of the output:
Address created: 0xBCDEE5C2dE9b7059120B067cf812d11C0D8Fa406
Mnemonic Phrase:
fatigue asthma neck usage bacon pen innocent relief tennis fetch chef arrange
Server Password: 0883290e4f500a0ffeac350e9e8ac
You could list your keys with the following command:
c:\> codeb_cli.exe keys -a list
Send anonymous message to group or group member
As all keys and ZKP material has been created you can now actually send a message. Keep in mind that you need to enclose the message/payload with quotation marks in case it contains spaces.
Also note that registered key address is used ONLY to retrieve the ZKP material. It is NOT used to send or encrypted the message!
c:\> codeb_cli.exe message -a send -i <groupid> -l <payload/message> -s <registered key address> -p <registered key password> -r <unregistered key address> -w <unregistered key password> -g <groups address> -t <optional recipients address>
NOTE:
- If you do not specify the unregistered key address the system will use the registered key address instead and the message will NOT be anonymous anymore.
- The parameter -t is optional. If you do not specify the message is sent to all members in the group.
List messages in inbox
To list the messages in your inbox you need the key address and password of your unregistered key.
c:\> codeb_cli.exe message -a list -r <address of unregistered key> -w <password of unregistered key>
The output is a comma separated list of message id’s.
Read your message
To retrieve the content of your message use the following command:
c:\> codeb_cli.exe message -a receive -r <address of unregistered key> -w <password of unregistered key> -x <message id>