npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@slicekit/erc8128-cli

v0.0.4

Published

CLI tool for signing HTTP requests with ERC-8128 (Ethereum HTTP signatures)

Downloads

466

Readme

erc8128 curl

CLI tool for signing HTTP requests with ERC-8128 (Ethereum HTTP signatures). Think of it as a curl extension that adds Ethereum-based authentication.

Installation

npm install -g @slicekit/erc8128-cli

Or use directly with npx:

npx @slicekit/erc8128-cli curl <url>

Usage

erc8128 curl [options] <url>

Minimal usage with config

If you have .erc8128rc.json set up, the minimal command is just:

erc8128 curl https://api.example.com/orders

HTTP Options

-X, --request <method>    HTTP method (GET, POST, etc.) [default: GET]
-H, --header <header>...  Add header (can be specified multiple times)
-d, --data <data>         Request body (use @file or @- for stdin)
-o, --output <file>       Write response to file
-i, --include             Include response headers in output
-v, --verbose             Show request details
--json                    Output response as JSON
--dry-run                 Sign only, do not send the request
--fail                    Exit non-zero for non-2xx responses
--config <path>           Path to .erc8128rc.json

Wallet Options

You can use the following options to provide a wallet:

--keystore <path>         Path to encrypted keystore file
--password <pass>         Keystore password
--interactive             Prompt for keystore password interactively
--keyfile <path>          Path to a raw private key file (use - for stdin) (⚠️ insecure)
--private-key <key>       Raw private key (⚠️ insecure)

Environment Variables:

  • ETH_PRIVATE_KEY for raw private key auth (⚠️ insecure)
  • ETH_KEYSTORE_PASSWORD for non-interactive keystore decryption

⚠️ Security Warning: Using --private-key or ETH_PRIVATE_KEY is insecure as the key may be visible in shell history. Use --keystore for better security.

ERC-8128 Options

You can use the following options to configure the ERC-8128 signature:

--chain-id <id>               Chain ID [default: 1]
--binding <mode>              request-bound | class-bound [default: request-bound]
--replay <mode>               non-replayable | replayable [default: non-replayable]
--ttl <seconds>               Signature TTL in seconds [default: 60]
--components <component>...   Components to sign (can be specified multiple times)
                                - Additional components for request-bound signatures
                                - Required Components for class-bound signatures
--keyid <keyid>               Expected key id (erc8128:chainId:address)

Examples

Simple GET request

erc8128 curl --keystore ./keyfile.json https://api.example.com/data

Keystore + interactive password prompt

erc8128 curl \
  --keystore ~/.ethereum/keystores/my-key \
  --interactive \
  https://api.example.com/data

POST with JSON data

erc8128 curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"foo":"bar"}' \
  --keystore ./keyfile.json \
  https://api.example.com/submit

Using keyfile + keyid

erc8128 curl -X POST \
  -d @body.json \
  --keyfile ~/.keys/bot.key \
  --keyid erc8128:8453:0xabc... \
  https://api.example.com/orders

Dry run (sign only)

erc8128 curl -X POST \
  -d @body.json \
  --keyfile ~/.keys/bot.key \
  --dry-run \
  https://api.example.com/orders

Using private key

erc8128 curl --private-key 0x... https://api.example.com/data

Config

You can set defaults in .erc8128rc.json. The CLI looks for:

  1. --config <path> if provided
  2. ./.erc8128rc.json in the current working directory
  3. ~/.erc8128rc.json

Example:

{
  "chainId": 8453,
  "binding": "request-bound",
  "replay": "non-replayable",
  "ttl": 120,
  "keyfile": "/Users/you/.keys/bot.key",
  "keyid": "erc8128:8453:0xabc...",
  "headers": ["Content-Type: application/json"],
  "components": ["x-idempotency-key"]
}

With environment variable

export ETH_PRIVATE_KEY=0x...
erc8128 curl https://api.example.com/data

Verbose output

erc8128 curl -v \
  --keystore ./keyfile.json \
  https://api.example.com/data

Save response to file

erc8128 curl -o response.json \
  --keystore ./keyfile.json \
  https://api.example.com/data

Include response headers

erc8128 curl -i \
  --keystore ./keyfile.json \
  https://api.example.com/data

Custom chain ID and signature options

erc8128 curl \
  --chain-id 137 \
  --binding class-bound \
  --replay replayable \
  --ttl 300 \
  --keystore ./keyfile.json \
  https://api.example.com/data

How It Works

erc8128 curl uses the ERC-8128 standard to sign HTTP requests with Ethereum accounts. The signature is added to the request headers using the HTTP Message Signatures standard (RFC 9421).

The tool:

  1. Creates an Ethereum signer from your wallet
  2. Builds the HTTP request with your specified options
  3. Signs the request according to ERC-8128
  4. Sends the signed request and displays the response

Development

# Install dependencies
npm install

# Build
npm run build

# Run locally
node dist/index.js --help

License

MIT