This commit is contained in:
mfahampshire
2026-06-09 19:04:43 +01:00
parent 69c54674cf
commit 181e1f7526
3 changed files with 23 additions and 21 deletions
@@ -19,6 +19,9 @@ import {
} from './lib';
const RPC_PRESETS = ['https://ethereum-sepolia-rpc.publicnode.com', 'https://rpc.sepolia.org'];
// Fixed shield amount: a single small value so the shared, faucet-funded testnet
// wallet can't be drained by an arbitrary amount.
const SHIELD_AMOUNT = '0.01';
const IP_ECHO_URL = 'https://ipinfo.io/ip';
const IP_SHAPE_RE = /^[\d.:a-f]{3,45}$/i;
@@ -32,7 +35,6 @@ export function RailgunDemo() {
const [railgunWallet, setRailgunWallet] = useState<RailgunWalletInfo | null>(null);
const [rpc, setRpc] = useState(RPC_PRESETS[0]);
const [balance, setBalance] = useState('');
const [shieldAmount, setShieldAmount] = useState('0.001');
const [txHash, setTxHash] = useState<string | null>(null);
const [storageStatus, setStorageStatus] = useState('');
const [busy, setBusy] = useState(false);
@@ -194,7 +196,7 @@ export function RailgunDemo() {
publicWallet: publicWalletRef.current,
railgunWallet,
provider,
amountStr: shieldAmount.trim(),
amountStr: SHIELD_AMOUNT,
log: dlog,
onTxHash: setTxHash,
});
@@ -298,9 +300,8 @@ export function RailgunDemo() {
<div style={box}>
<div style={legend}>Shield ETH into a private note</div>
<div style={row}>
<label style={sub}>amount (ETH)</label>
<input style={input} value={shieldAmount} onChange={(e) => setShieldAmount(e.target.value)} placeholder="0.001" />
<Button onClick={shield} disabled={!connected || !railgunWallet || busy}>Shield</Button>
<Button onClick={shield} disabled={!connected || !railgunWallet || busy}>Shield {SHIELD_AMOUNT} ETH</Button>
<span style={sub}>Fixed at {SHIELD_AMOUNT} ETH so the shared testnet wallet isn't drained.</span>
</div>
{txHash && (
<div style={{ marginTop: '0.5rem' }}>
@@ -174,7 +174,8 @@ export async function shieldEth(opts: {
const txHash = keccak256(signedHex);
log(` signed tx hash: ${txHash}`);
log(` -> To: ${populated.to} (Railgun Sepolia proxy contract)`);
log(` -> calldata selector: ${(populated.data || '').slice(0, 10)}`);
log(` -> calldata selector: ${(populated.data || '').slice(0, 10)} (Railgun shield function; Etherscan decodes this)`);
log(` -> full calldata: ${populated.data || ''}`);
onTxHash(txHash);
let sentTx: any;
@@ -15,35 +15,35 @@ export function MixnetGlossary() {
return (
<ul>
<li>
<strong>Mixnet.</strong> An overlay network that routes your traffic through several relays
and mixes it with other people's, hiding who is talking to whom. Nym operates one. See{' '}
<strong>Mixnet.</strong> An overlay network that routes your traffic through several relays,
mixed in with everyone else's, so no single point can link sender to receiver. See{' '}
<L href="/network/mixnet-mode">mixnet mode</L>.
</li>
<li>
<strong>Entry gateway.</strong> Your first hop into the mixnet. Your browser holds one
WebSocket to it; all tunnelled traffic rides that connection as opaque frames. See{' '}
<L href="/network/infrastructure/nym-nodes">Nym nodes</L>.
<strong>Entry gateway.</strong> Your first hop into the mixnet. The browser holds one
WebSocket to it, and all tunnelled traffic travels over that single connection as opaque
frames. See <L href="/network/infrastructure/nym-nodes">Nym nodes</L>.
</li>
<li>
<strong>IPR (IP Packet Router), the exit.</strong> The mixnet's exit point onto the normal
internet. The RPC node and gateway see the IPR's IP address, never yours. See{' '}
<strong>IPR (IP Packet Router), the exit.</strong> Where traffic leaves the mixnet for the
public internet. The destination sees the IPR's IP, not yours. See{' '}
<L href="/network/infrastructure/exit-services#ip-packet-router">exit services</L>.
</li>
<li>
<strong>SURB (single-use reply block).</strong> A prepaid, single-use return envelope. It
lets the exit send a reply back through the mixnet without learning your address. See{' '}
<strong>SURB (single-use reply block).</strong> A prepaid, single-use return envelope. The
exit replies through it without ever learning your address. See{' '}
<L href="/network/mixnet-mode/anonymous-replies">anonymous replies</L>.
</li>
<li>
<strong>Cover traffic / Poisson timing.</strong> Decoy packets and randomised send timing.
Together they keep your real traffic statistically hard to pick out. See{' '}
<strong>Cover traffic / Poisson timing.</strong> Decoy packets sent on randomised timing, so
your real traffic blends into a steady stream. See{' '}
<L href="/network/mixnet-mode/cover-traffic">cover traffic</L>.
</li>
<li>
<strong>mixFetch.</strong> The{' '}
<L href="/developers/mix-fetch"><code>@nymproject/mix-fetch</code></L> package's{' '}
<code>fetch()</code>-shaped function. It runs the mixnet client (smolmix) in a Web Worker and
sends your request through the mixnet instead of the browser's network stack.
<strong>mixFetch.</strong> A <code>fetch()</code>-shaped function from{' '}
<L href="/developers/mix-fetch"><code>@nymproject/mix-fetch</code></L>. It runs the mixnet
client (smolmix) in a Web Worker, so each request goes through the mixnet rather than the
browser's network stack.
</li>
</ul>
);