Skip to main content

Testnet Faucet

The testnet faucet (ghost-faucet, port 3005) distributes GHOST tokens to developers and users on the Specter testnet. It dispenses 100 GHOST per request with a 24-hour cooldown per recipient address.

Overview

GHOST is the native gas token of the Specter chain. Without GHOST, users cannot submit transactions — including the reveal transactions that complete a Ghost Protocol flow. The faucet provides a frictionless way for new users and developers to obtain testnet GHOST for experimentation.

Current State

MetricValue
Faucet balance56.9M GHOST
Drip amount100 GHOST
Cooldown period24 hours per address

API

POST /drip

Sends 100 GHOST to the specified recipient address.

Request:

{
"address": "0x1234567890abcdef1234567890abcdef12345678"
}

Response (success):

{
"success": true,
"txHash": "0xabc123...",
"amount": "100",
"recipient": "0x1234567890abcdef1234567890abcdef12345678"
}

Response (cooldown active):

{
"error": "Address is in cooldown period",
"nextAvailable": "2026-03-17T14:30:00Z",
"remainingSeconds": 43200
}

Response (invalid address):

{
"error": "Invalid Ethereum address"
}

GET /health

Returns faucet status and balance.

{
"status": "healthy",
"balance": "56900000",
"dripAmount": "100",
"cooldownHours": 24,
"totalDrips": 1250,
"uptime": 864000
}

Cooldown Mechanism

The faucet tracks the last drip timestamp for each recipient address in an in-memory map backed by periodic disk persistence. When a drip request arrives:

  1. Look up the recipient address in the cooldown map.
  2. If no entry exists, or the entry's timestamp is more than 24 hours old, proceed with the drip.
  3. If the cooldown is still active, reject the request with the time remaining.
  4. After a successful drip, update the cooldown map with the current timestamp.

The cooldown is enforced per recipient address, not per requesting IP. This means a single user cannot circumvent the cooldown by switching IP addresses (they would need a different wallet address).

Rate Limiting

In addition to the per-address cooldown, the faucet enforces global rate limits to prevent abuse:

LimitValue
Global request rate30 requests/minute
Per-IP request rate5 requests/minute
Max payload size1 KB

These limits protect the faucet from automated draining attacks where an adversary generates many fresh addresses to bypass the per-address cooldown.

Transaction Submission

The faucet submits native GHOST transfers using an operator wallet:

  1. Construct a simple value transfer transaction to the recipient address with value = 100 * 10^18 (100 GHOST in wei).
  2. Estimate gas and set a gas price based on current network conditions.
  3. Sign the transaction with the operator private key.
  4. Submit the transaction and return the transaction hash to the caller.

The faucet does not wait for transaction confirmation before responding — it returns the transaction hash immediately. The client can poll the chain for confirmation if needed.

Nonce Management

The faucet maintains a local nonce counter to handle rapid sequential drip requests without waiting for each transaction to be mined. This prevents nonce collision errors when multiple drip requests arrive within the same block time.

If a transaction fails due to a nonce mismatch (e.g., after a service restart), the faucet resynchronizes its nonce from the chain and retries.

Balance Monitoring

The faucet periodically checks its on-chain GHOST balance and logs warnings when the balance drops below configurable thresholds:

ThresholdAction
< 1,000,000 GHOSTWarning logged
< 100,000 GHOSTAlert logged, reduced drip amount considered
< 10,000 GHOSTCritical alert, faucet may pause drips

At the current drip rate of 100 GHOST per request with a 24-hour cooldown per address, the 56.9M GHOST balance is sufficient for hundreds of thousands of unique addresses.

Configuration

ParameterDefaultDescription
PORT3005HTTP server port
RPC_URLSpecter chain RPC endpoint
OPERATOR_PRIVATE_KEYFaucet operator wallet private key
DRIP_AMOUNT100GHOST tokens per drip (in whole units)
COOLDOWN_HOURS24Cooldown period between drips for the same address