Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kassandraoftroy committed Sep 17, 2023
1 parent 6e2ffda commit 17b73d1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ the above example would output:

-----------------------

compute the private key for a stealth address you control

```bash
stealthereum reveal-stealth-key -k path/to/keyfile.json -s 0xSomeStealthAddress -e 0xSomeEphemeralPubkey
```

note that this requires you to know in advance what `[stealth_address, ephemeral_pubkey]` pairs are actually payments meant for your stealth meta address. To find this out see `scan` command below.

-----------------------

scan announced stealth transfers for payments to your stealth meta address

```bash
Expand All @@ -63,15 +73,11 @@ For now a scanfile has to be precomputed into a JSON format like so
"ephemeral_pubkey": "0xSomeEphemeralPubkey",
"view_tag": 116
},
...
{
"stealth_address": "0xSomeOtherAddress",
"ephemeral_pubkey": "0xSomeOtherPubkey",
"view_tag": 94
}
]
}
```

-----------------------

compute the private key for a stealth address you control

```bash
stealthereum reveal-stealth-key -k path/to/keyfile.json -s 0xSomeStealthAddress -e 0xSomeEphemeralPubkey
```
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ enum Commands {
/// path to keyfile containing stealth meta address keys
#[arg(short, long, required=true, value_name = "FILE")]
keyfile: Option<PathBuf>,
/// path to scanfile containing a ScannableList JSON like {announcements: [{stealth_address:, ephemeral_pubkey:, view_tag:}...]}
/// path to scanfile containing a ScannableList JSON e.g. {announcements: [{stealth_address:, ephemeral_pubkey:, view_tag:}]} (see README for more info)
#[arg(short, long, required=true, value_name = "FILE")]
scanfile: Option<PathBuf>,
},
Expand Down Expand Up @@ -259,14 +259,14 @@ fn scan_for_payments(keyfile: &PathBuf, scanfile: &PathBuf) {
let file_result = read_file(scanfile);
let string_file = match file_result {
Ok(val) => val,
Err(error) => panic!("error reading keyfile: {:?}", error),
Err(error) => panic!("error reading scanfile: {:?}", error),
};

let sl_result = parse_scannable_list(&string_file);

let sl = match sl_result {
Ok(val) => val,
Err(error) => panic!("error parsing keyfile: {:?}", error),
Err(error) => panic!("error parsing scanfile: {:?}", error),
};

let (sk, vk) = extract_keys_from_keyfile(keyfile);
Expand All @@ -289,6 +289,7 @@ fn scan_for_payments(keyfile: &PathBuf, scanfile: &PathBuf) {
);
}
}
println!("\nscan complete");
}

fn new_stealth_address(receiver: &String) {
Expand Down

0 comments on commit 17b73d1

Please sign in to comment.