Troubleshooting
Common issues when developing on Specter testnet and how to resolve them.
Gas price returns 0
Symptom: eth_gasPrice returns 0x0, causing transactions to fail.
Cause: The Cosmos EVM module may report 0 gas price, but the chain enforces a minimum of 1 gwei.
Fix: Always set gas price explicitly:
// viem
const hash = await walletClient.sendTransaction({
to: recipient,
value: amount,
gasPrice: 1_000_000_000n, // 1 gwei
});
// ethers.js
const tx = await contract.myFunction({
gasPrice: 1_000_000_000n,
});
# Foundry
cast send $CONTRACT "myFunction()" \
--gas-price 1000000000 \
--rpc-url https://testnet.specterchain.com
Transaction nonce errors
Symptom: nonce too low or nonce already used errors.
Fix: Reset your MetaMask account (Settings > Advanced > Clear activity tab data), or manually specify the nonce:
NONCE=$(cast nonce $YOUR_ADDRESS --rpc-url https://testnet.specterchain.com)
cast send $CONTRACT "myFunction()" --nonce $NONCE ...
PoseidonT3 library not linked
Symptom: Deployment fails with unresolved library or similar errors when deploying Ghost Protocol contracts.
Fix: Add the libraries directive to your foundry.toml:
libraries = [
"lib/poseidon-solidity/contracts/PoseidonT3.sol:PoseidonT3:0xa786eDD407eb9EbaCA5E624B7Ee7C31E3b7f9521",
]
See Foundry Setup for the complete configuration.
Commitment not found after commit
Symptom: You committed tokens but the reveal fails with InvalidRoot.
Cause: The Merkle root hasn't been updated on-chain yet. The root updater relayer watches for CommitmentAdded events and updates the on-chain root. This typically takes 5–15 seconds.
Fix: Wait for the root update. You can poll the commitment tree contract:
# Check if root has been updated
cast call 0xB7E37E652F3024bAaaf84b12ae301f8E1feC4D87 \
"isKnownRoot(bytes32)(bool)" $MERKLE_ROOT \
--rpc-url https://testnet.specterchain.com
Reveal proof rejected
Symptom: InvalidProof error when calling reveal().
Common causes:
- Wrong inputs — public inputs must exactly match the commitment preimage values
- Stale root — the proof was generated against a root that's no longer in the 100-root history window
- Nullifier already spent — this commitment has already been revealed
Check the nullifier registry:
cast call 0x0987cc3dE6f76c4c8834Dc6205De24968091C58b \
"isSpent(bytes32)(bool)" $NULLIFIER \
--rpc-url https://testnet.specterchain.com
Relayer API errors
Symptom: 401 or 403 from relayer endpoints.
Cause: The commitment relayer and proof relayer require HMAC authentication.
Fix: Ensure you're including the correct HMAC signature in request headers. See Commitment Relayer and Proof Relayer for authentication details.
RPC connection issues
Symptom: Cannot connect to https://testnet.specterchain.com.
Checklist:
- Verify URL is correct (no trailing slash for JSON-RPC)
- Check chain ID is
5445 - Try the direct IP:
http://143.198.23.194:8545(for debugging only) - WebSocket endpoint is
wss://testnet.specterchain.com/ws