#gas #privacy #ethereum #stealth #eth

app stealth-gas-cli

CLI for managing Ethereum blind gas tickets on client side

2 releases

new 0.0.2 Jan 12, 2025
0.0.1 Jan 8, 2025

#658 in Magic Beans

Download history 265/week @ 2025-01-07

265 downloads per month

MIT license

47KB
638 lines

stealth-gas-cli

a command line tool for client side operations with a Stealth Gas Station service. It wraps the eth-stealth-gas-tickets rust library for cryptographic operations.

Installation

cargo install stealth-gas-cli

Supported Networks

  • Holesky Ethereum (chain id: 17000)

(more soon)

Usage

step 1: fetch the coordinator pubkey and other public parameters (this is just for convenience you can fetch this onchain yourself as well)

stealth-gas params --rpc-url https://ethereum-holesky-rpc.publicnode.com

step 2: generate 10 unsigned tickets

stealth-gas new --key 0xCoordinatorPubKey --num 10 --output unsigned_tickets.json

step 3: call buyGasTickets with your 10 unsigned tickets

stealth-gas buy --rpc-url https://ethereum-holesky-rpc.publicnode.com --contract-address 0xGasStationAddress --input unsigned_tickets.json --private-key 0xPrivateKey

step 4: after buying gas tickets (wait for finalization), scan the chain for blind signatures that match your unsigned tickets.

stealth-gas scan --rpc-url https://ethereum-holesky-rpc.publicnode.com --contract-address 0xGasStationAddress --input unsigned_tickets.json --start-block 1000000 --output finalizeable.json

step 5: after finding your 10 signed (blind) tickets in the scan, finalize the blind signatures to generate redeemable gas tickets

stealth-gas finalize -r https://ethereum-holesky-rpc.publicnode.com -i finalizeable.json -o signed_tickets.json

step 6: user can now send a SpendRequest to the coordinator server and redeem the 10 signed tickets (or any number of tickets depending on how many SignedTickets are in the input JSON file)

stealth-gas redeem -u https://0000000000.org -i ~/Desktop/st100.json -s '[{"amount": "9900000000000000", "receiver": "0xYourAnonAddress"}]'

here we redeem 10 signed tickets worth 0.01 ETH in total. We send 0.0099 ETH to 0xYourAnonAddress. (Since there is leftover the coordinator will take it and transfer herself 0.0001 ETH)

Since 0xYourAnonAddress is anonymous, then redeemer retains privacy because no one knows which ticket was redeemed (not even the coordinator).

Dependencies

~23–36MB
~621K SLoC