Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ERC5564 Stealth Address scanning #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

joshieDo
Copy link

@joshieDo joshieDo commented Jul 14, 2024

Stealth addresses

Scans committed blocks for stealth addresses according to ERC5564.

Node

export VIEW_KEY=0x...
stealthy node ...

Generation

Usage: stealthy gen [OPTIONS] <COMMAND>

Commands:
  addr  Generate a stealth address from a stealth meta address alongside an optional encrypted note
  meta  Generate a stealth meta address from view and spend private keys
  key   Generate the stealth address private key from the ephemeral public key and view & spend private keys

Comment on lines +5 to +21
## Node

```bash
export VIEW_KEY=0x...
stealthy node
```

## Generation

```bash
Usage: stealthy gen [OPTIONS] <COMMAND>

Commands:
addr Generate a stealth address from a stealth meta address alongside an optional encrypted note
meta Generate a stealth meta address from view and spend private keys
key Generate the stealth address private key from the ephemeral public key and view & spend private keys
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we show a full flow of generating the address and using it, including the command outputs?

Comment on lines +45 to +49
// add network name to logs dir
self.logs.log_file_directory =
self.logs.log_file_directory.join(self.chain.chain.to_string());

let _guard = self.logs.init_tracing()?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to do it separately here? Node command should already handle it for us I think

@@ -0,0 +1,160 @@
#![allow(dead_code)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Comment on lines +35 to +37
let expect_str = "to be 33 bytes.";

let eph_pub = hex::decode(value).expect(expect_str);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be inlined? same in other places


/// Checks every committed chain of blocks for stealth addresses belonging to us according to [ERC-5564](https://eips.ethereum.org/EIPS/eip-5564).
///
/// Assumes that `VIEW_KEY` has been set as an environment variable.
Copy link
Contributor

@shekhirin shekhirin Jul 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we can show how to pass a custom node CLI argument here

cli::Cli::parse().run(|builder, _| async move {
let handle = builder
.node(EthereumNode::default())
.install_exex("Stealthy", init_stealthy)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be inlined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example New example
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants