Skip to content

feat: ERC5564 Stealth Address scanning#1

Open
joshieDo wants to merge 2 commits into
mainfrom
joshie/5564
Open

feat: ERC5564 Stealth Address scanning#1
joshieDo wants to merge 2 commits into
mainfrom
joshie/5564

Conversation

@joshieDo

@joshieDo joshieDo commented Jul 14, 2024

Copy link
Copy Markdown

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
Copy Markdown
Member

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
Copy Markdown
Member

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
Copy Markdown
Member

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
Copy Markdown
Member

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.

@shekhirin shekhirin Jul 15, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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