Chameleon
Start
OverviewHow it worksQuickstart
Concepts
ConceptsPrivacy model
Reference
The routerJavaScript engineContracts and addresses
Practice
Real examplesSelling and exitingSecurity and limitsFAQChangelog
Robinhood Chain · 4663

Quickstart

You can use Chameleon from the Try it page, or from code. Both use the same engine.

From the browser

  1. Open Try it and click Generate random keys. Download the backup.
  2. Go to Send, pick a recent launch, and click Build the buy. You get a one-time address and the exact call data for the router.
  3. Go to Scan to find your buys. Use the local simulation to see how the view tag filters announcements.

From code

The engine is an ES module with one dependency, bundled in site/assets/vendor/noble.js.

import { randomKeys, generateStealth, encodeBuy, scan, decodeAnnouncementLog,
         ANNOUNCEMENT_TOPIC, ANNOUNCER } from './assets/core/stealth.js';

// receiver, once
const keys = randomKeys();
console.log(keys.metaAddress);          // share this

// sender, for each buy
const s = generateStealth(keys.metaAddress);
const data = encodeBuy({
  curve: '0x...',                       // a Pons curve
  minTokensOut: 1n,
  stealth: s.stealthAddress,
  ephemeralPubKey: s.ephemeralPubKey,
  viewTag: s.viewTag,
  gasDust: 20000000000000n,             // 0.00002 ETH
});
// send `data` to the router with value = quote + gasDust

// receiver, later
const logs = await rpc('eth_getLogs', [{ address: ANNOUNCER, topics: [ANNOUNCEMENT_TOPIC], fromBlock }]);
const { found } = scan(logs.map(decodeAnnouncementLog), keys);
console.log(found[0].stealthAddress, found[0].privateKey);

Run the tests

You need Node 20+ and Foundry. Contract tests and the end-to-end test fork the real Robinhood Chain.

node --test tests-js/engine.test.mjs        # 12 engine tests, cross-checked with cast
cd contracts && forge test                    # 11 router tests against the real Pons curve
node tests-js/e2e-fork.mjs                    # full round trip on a fork

Run the site

launch.bat                                    # builds the pages and serves http://127.0.0.1:5780
NoteThe router address is empty in site/assets/js/config.js until it is deployed. The demo builds the exact call and a wallet button appears once an address is set.