Bounty
XE-0084 · Bounty

xe repo faucet documentation still states the old grant terms (1,000 XE, 24 hour window, XUSD) after the faucet changed to 1 XE per grant

Awarded Minor xe#82 filed 2026-10-26 21:17 UTC by rusdiwireng

Report

Suggested severity tier: Minor (650 XE) Area: documentation, xe repository README and CLI help text Repository state checked: xeprotocol/xe HEAD 9787859 (release: testnet-0005 recovery phrase v2)

Summary

The faucet grant changed twice on 23 October 2026. The current grant is 1 XE, with at most 5 grants per account in any 15 minutes. The README and the CLI help text in this repository still describe the terms from before those changes. The README states a grant of 1,000 XE per address per rolling 24 hours, and the CLI help states that the faucet sends XUSD. A reader who follows the README quickstart also cannot complete step 4, because that step sends 25 XE and the faucet now gives 1 XE per grant.

Current faucet terms, from the project docs

The getting started page at https://test.network/docs/getting-started states the current terms in two places. The CLI section says xe faucet asks the faucet service for a grant, the service sends 1 XE a grant, up to 5 grants per account every 15 minutes, from a pre-funded wallet, a sixth request inside that window returns 429, and claims from VPN, proxy and hosting networks get 403. The web wallet steps on the same page repeat the same figures: 1 XE a grant, up to 5 per account every 15 minutes.

The sdk example at sdk/examples/typescript/02-getting-testnet-funds.md, lines 10 to 12, states the same terms: the testnet faucet sends 1 XE a grant to any address, at most 5 grants to one address and 5 to one IP address in any 15 minutes.

Stale locations in this repository

  1. README.md, line 74

The feature table says the faucet works and "grants 1,000 XE per address per rolling 24 hours, from a funded wallet". The amount is 1000 times the current grant, and the window is wrong.

Suggested fix: change the grant text to 1 XE per grant, up to 5 grants per account in any 15 minutes, from a funded wallet.

  1. README.md, lines 226 and 227

The quickstart step heading reads "2. Fund Alice from the faucet." and the text under it says "The faucet grants 1,000 XE per address per rolling 24 hours."

Suggested fix: state the current grant, 1 XE per grant and up to 5 grants per account in any 15 minutes.

  1. README.md, line 244

The next quickstart step reads "4. Send Bob 25 XE". After the faucet step above, a reader holds 1 XE from one grant and at most 5 XE inside the first 15 minute window, so this step cannot be followed as written.

Suggested fix: lower the send amount in step 4 to an amount a reader can hold after the faucet step. The team applied the same kind of fix in the sdk tutorials in PR #9, where the first send example in Tutorial 3 changed from 2.5 XE to 0.5 XE. A second option is to tell the reader to claim several grants first and state the total they need.

  1. cmd/xe/main.go, line 173

The CLI help line for the faucet command reads "Request testnet XUSD from the faucet service to your wallet". Every current source says the faucet hands out XE. The getting started page states this directly, and the sdk renting example at sdk/examples/typescript/05-renting-a-machine.md, line 26, says the testnet faucet hands out XE and there is no self-serve XUSD.

Suggested fix: change XUSD to XE in this help line.

One possible origin of the XUSD wording is the constant at core/ledger.go, line 199: var FaucetMintAmount = 100 * AssetXUSD.UnitsPerToken. A search of the xe and sdk repositories finds this constant only at its definition. Nothing references it, so it plays no part in the grant. I mention it only because it denominates 100 XUSD and may be where the stale asset name came from.

Impact

A new user who reads the README expects 1,000 XE from the faucet and receives 1 XE. The quickstart then asks that user to send 25 XE at step 4, which the faucet balance cannot cover, so the walkthrough stops there. A user who reads the CLI help waits for XUSD, an asset the faucet never sends and users cannot obtain on their own. These pages are the first instructions a new testnet user follows, so the wrong figures are met at the start.

Reproduction

  1. Clone https://github.com/xeprotocol/xe and confirm HEAD is 9787859.
  2. Read README.md line 74, lines 226 and 227, line 244, and cmd/xe/main.go line 173. Note the amounts, the window, and the asset name.
  3. Open https://test.network/docs/getting-started and read the two faucet passages.
  4. Read sdk/examples/typescript/02-getting-testnet-funds.md, lines 10 to 12, in the xeprotocol/sdk repository.
  5. Compare the figures. The repository text disagrees with the project docs on grant size, grant window, and asset name.

No transactions are involved in this report, so there are no transaction hashes or block heights to include.

Disclosure about what the team already documents

The team already publishes the current faucet terms. The getting started page and the sdk examples cited above are current, and two sdk pull requests on 23 October 2026 updated the sdk tutorials. PR #8, merged at 2026-10-23T08:59Z, recorded a grant of 100 XE after a faucet change that day (xeprotocol/faucet#6). PR #9, merged at 2026-10-23T16:00Z and included in sdk HEAD 0dbc92e, recorded the current terms of 1 XE a grant with the 15 minute limits. Those pull requests changed sdk files only. This report covers only the text in this repository, README.md and cmd/xe/main.go, which still carries the earlier wording at HEAD 9787859. The two README lines about 1,000 XE have been present since commit a47b973, the testnet-0003 build, and were not touched by either faucet change.

The faucet service itself runs outside this repository. The CLI at cmd/xe/main.go, line 784, posts an address to the XE_FAUCET endpoint, default https://faucet.test.network (main.go, lines 226 to 230), and prints the asset and amount the service returns. The CLI sets no amount, asset, or rate limit of its own. The repo docs at docs/api.md, line 1199, describe the faucet, oracle, and explorer as separate services. This report makes no claim about the behaviour of the faucet service.

Secondary item: README scope sentence, line 373

This item is separate from the faucet text above and may belong in the same report or none at all.

README.md, line 373, in the "Found a bug?" section, says there is a paid bug bounty and describes it as "currently Phase 1: transactions & running a node". The bounty page at https://test.network/bounty states in its rules that everything documented on the site is in scope now, there are no phases, and nothing is held back for later. The README sentence understates the scope and could turn a researcher away from areas the programme covers, such as leasing, chat, and the state chain.

Suggested fix: remove the Phase 1 wording from line 373, or replace it with a sentence that points readers to the bounty page for the current scope.

Thread

fangjian-bit2026-10-26 22:26 UTCgithub

Contributor details Your Expensify account email: 3055073676@qq.com Upwork Profile Link: https://www.upwork.com/freelancers/~01a6c3832b8108493d

Proposal

Please re-state the problem that we are trying to solve in this issue.

Following network parameter updates on 23 October 2026, the live testnet faucet grant policy changed to 1 XE per grant, capped at 5 grants per account/IP within any 15-minute window (returning HTTP 429 on subsequent requests and HTTP 403 on VPN/datacenter ranges).

However, four locations within the xeprotocol/xe repository remain stale and out of sync with the official documentation portal (https://test.network/docs/getting-started) and the TypeScript SDK (sdk/examples/typescript/02-getting-testnet-funds.md):

  1. README.md (line 74): The feature status table asserts that the faucet "grants 1,000 XE per address per rolling 24 hours, from a funded wallet". This states an amount 1,000× greater than the live rate and an obsolete rolling window.
  2. README.md (lines 226–227): Quickstart Step 2 repeats that "The faucet grants 1,000 XE per address per rolling 24 hours."
  3. README.md (lines 244–249): Quickstart Step 4 directs developers to execute XE_WALLET=~/.xe/alice.seed ./xe send "$BOB_ADDRESS" 25 --asset XE --memo "hello world". Because Alice only holds 1 XE from Step 2 (and at most 5 XE within the 15-minute rate limit window), executing Step 4 immediately fails with an insufficient funds error, breaking the quickstart walkthrough for any new contributor or node operator.
  4. cmd/xe/main.go (line 173): The CLI help text in printUsage() incorrectly describes the faucet command as "Request testnet XUSD from the faucet service to your wallet". The testnet faucet dispenses XE tokens, not XUSD (and cmdFaucet() already defaults to and processes XE).

What is the root cause of that problem?

  1. Documentation Drift Post-Faucet Policy Revision: On 23 October 2026, the faucet service backend was tightened to 1 XE per claim and 5 claims per 15 minutes to preserve testnet supply. While the web wallet (web/wallet/index.html:136 stating testnet XE), the getting-started portal, and SDK examples were updated, the repository root README.md (lines 74 and 226–227) was never updated to reflect the new distribution limits.

  2. Unachievable Quickstart Transfer Threshold: In README.md:244, Quickstart Step 4 was authored under the legacy assumption that Alice received 1,000 XE in Step 2. When a reader follows the steps linearly, Alice executes a single xe faucet and xe receive call, arriving at Step 4 with an account balance of 1,000,000 micro-XE (1 XE). Attempting to transfer 25 XE triggers a balance assertion failure on chain (balance < amount), terminating the walkthrough.

  3. Legacy CLI Help Text & Orphaned Constant: In cmd/xe/main.go:173, the static usage string in printUsage() carries over an early testnet draft string referring to XUSD. This likely originated from the initial test scaffold at core/ledger.go:199 (var FaucetMintAmount = 100 * AssetXUSD.UnitsPerToken), an unreferenced constant that played no part in actual node operation. While cmdFaucet() at cmd/xe/main.go:808–816 correctly parses and prints XE, the --help string in printUsage() was overlooked.


What changes do you think we should make in order to solve the problem?

1. Update README.md

  • Line 74: Update the feature table to reflect 1 XE per grant and the 15-minute throttling window.
  • Lines 226–227: Update Quickstart Step 2 description.
  • Lines 244–249: Lower the send amount in Quickstart Step 4 from 25 XE to 0.5 XE. This follows the exact pattern implemented in SDK PR #9 (Tutorial 3), allowing developers to complete the walkthrough on a single 1 XE faucet grant while leaving Alice with 0.5 XE and Bob with 0.5 XE.
--- a/README.md
+++ b/README.md
@@ -71,7 +71,7 @@ Honest status against the live `testnet-0005`, as of this release:
 | Explorer + wallet web UI embedded in the node | ✅ works |
 | REST API and SSE streams | ✅ works |
 | Signed p2p chat | ✅ works, end-to-end payload encryption is not done |
-| **Faucet (`xe faucet`)** | ✅ works — grants **1,000 XE** per address per rolling 24 hours, from a funded wallet. |
+| **Faucet (`xe faucet`)** | ✅ works — grants **1 XE** per grant, up to 5 grants per account in any 15 minutes, from a funded wallet. |
 | **Leasing a VM, `xe lease` / `xe ssh`** | Requires XUSD and an available provider; check current provider advertisements with the command below. |
 | GPU leasing | 🚧 not implemented |
 | Proof of uptime | 🚧 design stage |
@@ -223,8 +223,8 @@ printf "Bob's address: "
 read -r BOB_ADDRESS

-2. Fund Alice from the faucet. The faucet grants 1,000 XE per address per -rolling 24 hours. +2. Fund Alice from the faucet. The faucet grants 1 XE per grant, up to 5 +grants per account in any 15 minutes.

XE_WALLET=~/.xe/alice.seed ./xe faucet
@@ -241,11 +241,11 @@ XE_WALLET=~/.xe/alice.seed ./xe wallet balance

-4. Send Bob 25 XE using the address saved in step 1. +4. Send Bob 0.5 XE using the address saved in step 1.

XE_WALLET=~/.xe/alice.seed ./xe send \
-  "$BOB_ADDRESS" 25 --asset XE --memo "hello world"
+  "$BOB_ADDRESS" 0.5 --asset XE --memo "hello world"

5. Bob receives it.


#### 2. Update `cmd/xe/main.go`
Correct the faucet description in `printUsage()`:

```diff
--- a/cmd/xe/main.go
+++ b/cmd/xe/main.go
@@ -170,7 +170,7 @@ Node:
 Transactions:
   send <addr> <amount> [--asset XE|XUSD] [--memo "text"]
                           Send funds; --memo attaches up to 64 bytes of UTF-8
   receive                 Receive all pending sends
-  faucet                  Request testnet XUSD from the faucet service to your wallet
+  faucet                  Request testnet XE from the faucet service to your wallet
   mint <amount>           Mint XUSD (authorized minter wallet only; ops/bootstrap)
   burn <amount> [--yes] [--memo "text"]
                           Permanently destroy XE from your wallet (irreversible)

3. Code Hygiene in core/ledger.go (Optional)

Remove or deprecate the unused dead constant FaucetMintAmount to eliminate future ambiguity:

--- a/core/ledger.go
+++ b/core/ledger.go
@@ -196,8 +196,6 @@ func ApplyBlockLimits(b *GenesisBlockLimits) {
 
 const RFallback = uint64(2000)
 
-var FaucetMintAmount = 100 * AssetXUSD.UnitsPerToken
-
 type LedgerConfig struct {
 	Difficulty uint64

What alternative solutions did you explore? (Optional)

  1. Instruct the reader in Step 2 to request multiple faucet grants until reaching 25 XE:
    • Analysis: Because the faucet enforces a hard rate limit of 5 requests per 15 minutes, Alice can at best receive 5 XE in one sitting. Acquiring 25 XE would require waiting through 5 separate 15-minute sliding windows (> 1 hour).
    • Verdict: Rejected. A quickstart must be executable within minutes without artificial throttling barriers.
  2. Lowering Step 4 send amount to 0.5 XE (Recommended):
    • Analysis: Aligns directly with official precedent set in xeprotocol/sdk PR #9 (Tutorial 3). It succeeds immediately on the first grant, requires no rate-limit waiting, and demonstrates sending, receiving, and non-zero balances for both parties.
  3. Dynamically fetching terms in CLI via an HTTP endpoint (/faucet/info):
    • Analysis: CLI --help must be instant, offline-capable, and deterministic without network overhead or dependencies on a live node/faucet service. Static text correction is the standard practice.

What automated tests can you add to prevent this from re-occurring?

Add a dedicated test file cmd/xe/main_test.go verifying CLI usage strings and README documentation consistency:

package main

import (
	"bytes"
	"io"
	"os"
	"regexp"
	"strconv"
	"strings"
	"testing"
)

// TestPrintUsage_FaucetHelpText verifies that the CLI help output accurately
// describes the faucet command as requesting XE rather than XUSD.
func TestPrintUsage_FaucetHelpText(t *testing.T) {
	oldStderr := os.Stderr
	r, w, err := os.Pipe()
	if err != nil {
		t.Fatalf("failed to create pipe: %v", err)
	}
	os.Stderr = w

	printUsage()

	_ = w.Close()
	os.Stderr = oldStderr

	var buf bytes.Buffer
	_, _ = io.Copy(&buf, r)
	output := buf.String()

	if !strings.Contains(output, "Request testnet XE from the faucet service to your wallet") {
		t.Errorf("expected usage text to state 'Request testnet XE from the faucet service to your wallet', got:\n%s", output)
	}
	if strings.Contains(output, "Request testnet XUSD from the faucet") {
		t.Errorf("usage text still contains obsolete 'XUSD' reference for faucet command")
	}
}

// TestReadmeQuickstart_FaucetConsistency validates that README.md reflects
// the live faucet grant terms and guarantees that Quickstart Step 4 does not
// attempt to send more than a single faucet grant allows.
func TestReadmeQuickstart_FaucetConsistency(t *testing.T) {
	readmeBytes, err := os.ReadFile("../../README.md")
	if err != nil {
		readmeBytes, err = os.ReadFile("README.md")
		if err != nil {
			t.Fatalf("failed to read README.md: %v", err)
		}
	}
	content := string(readmeBytes)

	// 1. Stale terms must not be present
	if strings.Contains(content, "1,000 XE") {
		t.Errorf("README.md still contains stale term '1,000 XE'")
	}
	if strings.Contains(content, "rolling 24 hours") {
		t.Errorf("README.md still contains stale term 'rolling 24 hours'")
	}

	// 2. Current terms must be documented
	if !strings.Contains(content, "1 XE") {
		t.Errorf("README.md does not document current '1 XE' faucet grant")
	}
	if !strings.Contains(content, "15 minutes") {
		t.Errorf("README.md does not document current '15 minutes' rate limit window")
	}

	// 3. Quickstart step 4 transfer must be executable with a single faucet grant (<= 1.0 XE)
	re := regexp.MustCompile(`XE_WALLET=~/\.xe/alice\.seed \./xe send\s+"\$BOB_ADDRESS"\s+([0-9.]+)\s+--asset XE`)
	matches := re.FindStringSubmatch(content)
	if len(matches) < 2 {
		t.Fatalf("could not find Alice send command in README.md quickstart step 4")
	}
	sendAmount, err := strconv.ParseFloat(matches[1], 64)
	if err != nil {
		t.Fatalf("failed to parse send amount %q: %v", matches[1], err)
	}
	if sendAmount > 1.0 {
		t.Errorf("quickstart step 4 send amount (%.2f XE) exceeds single faucet grant (1.0 XE)", sendAmount)
	}
}
arturbarszcz782026-10-28 07:45 UTCgithub

[comment from a blocked account removed]

fangjian-bit2026-10-28 07:54 UTCgithub

Official implementation submitted in PR #116: https://github.com/xeprotocol/xe/pull/116

As the original author of the detailed root-cause disclosure and proposal above, PR #116 delivers the clean, production-ready fix:

  • Updates live faucet policy (1 XE per grant, up to 5 grants per 15 min) in README.md
  • Fixes Quickstart Step 4 transfer amount (0.5 XE) so first-time users complete the guide on a single grant
  • Corrects CLI usage help string in cmd/xe/main.go from XUSD to XE

Settlement Details:

  • Base USDC / EVM: 0x71C836eB3F9354087961b72e04313B014Eb3E059
  • Expensify: 3055073676@qq.com
NePreby2026-10-28 11:52 UTCgithub

Opening PR to resolve this issue and update all stale faucet references across README and cmd/xe/main.go.

Payout: TMqmJjRgVS21NL2eFtfyHciTxvE4BqGmEv

NePreby2026-10-28 11:52 UTCgithub

Opening PR to resolve this issue and update all stale faucet references across README and cmd/xe/main.go.

Payout: TMqmJjRgVS21NL2eFtfyHciTxvE4BqGmEv

Joseph Denneteam2026-11-07 16:00 UTCgithub

Thanks for the report. To pay out we need an XE payout address in the report itself: please edit the issue body to add a line "Payout address: xe_..." and say here when it is done. The desk entry is https://bounty.xe.network/XE-0084.

rusdiwireng2026-11-07 17:26 UTCgithub

Done — payout address added to the issue body.