firmalabs / zmsg

A zero knowledge messaging system built on zcash.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zmsg

A zero knowledge messaging system built on zcash.

zmsg uses the encrypted memo field of zcash shielded transactions to send messages to other parties. The sent messages get stored in the zcash blockchain and the recipient can check for messages at any time (no need to be online at the same time). Since the messages get stored in the blockchain, they are on every full zcash node. The implication here is that its not possible to tell who the target of any given message is.

Currently, each message sends 0.0001 ZEC. You can change this value by setting the --txval flag on sendmsg.

Installation

First, make sure you have rust installed, then:

cargo install github.com/firmalabs/zmsg

Usage

Note: To use zmsg, you'll need a running zcash daemon (node), a z_address, and some spare ZEC in that address.

zmsg 0.1.0
Pancy <pancy@firma.org>
A zero knowledge messaging system built on zcash.

USAGE:
    zmsg <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    check      Check incoming messages
    help       Prints this message or the help of the given subcommand(s)
    sendmsg    Send a 512-byte encrypted memo to a target z_address with a default spare ZEC of 0.0001 ZEC
    zaddr      Get my available shielded address(es)

sendmsg

$ export TARGET_ZADDR=zchfvC6iubfsAxaNrbM4kkGDSpwjafECjqQ1BZBFXtotXyXARz2NoYRVEyfLEKGCFRY7Xfj2Q3jFueoHHmQKb63C3zumYnU
$ zmsg sendmsg --to=$TARGET_ZADDR "Hello zmsg! welcome to pretty secure messaging"
Message sent to zchfvC6iubfsAxaNrbM4kkGDSpwjafECjqQ1BZBFXtotXyXARz2NoYRVEyfLEKGCFRY7Xfj2Q3jFueoHHmQKb63C3zumYnU with opid = <operation id>

check

Running zmsg check iterates through all available z_address and display transactions where change == false.

$ zmsg check

==========================================================================================
> Got 3 messages.
==========================================================================================
| Message #0 (val = 1)
| To: ztestsapling13vnh6svpvtpgntphha7nsafchx7zhhzu0gnptkztvahtvyueujwha2gcf976vt609qd8xjkaqwf
| Date: Sat May  8, 2021 at 23:48:02
|
|   Thanks for using zfaucet!
==========================================================================================
| Message #1 (val = 0.5)
| To: ztestsapling1hcm5sjeeesrzzhahr9txasjkupu5u0ajstxljy97qytxx3y6qku3w8gyf6tnqjfpz9f9w9jd9eg
| Date: Sat May 15, 2021 at 06:26:13
|
|   second payment
==========================================================================================
| Message #2 (val = 0.01)
| To: ztestsapling1hcm5sjeeesrzzhahr9txasjkupu5u0ajstxljy97qytxx3y6qku3w8gyf6tnqjfpz9f9w9jd9eg
| Date: Sat May  8, 2021 at 23:51:37
|
|   hello zcash
==========================================================================================

Note that this will take about a minute to compute the zero-knowledge proof, and another few minutes before the transaction gets propagated and confirmed for the other side to see it.

About

A zero knowledge messaging system built on zcash.

License:MIT License


Languages

Language:Rust 100.0%