Where your exchange keys go
When you connect Binance you paste in two things: an API key and a secret. The key works like a username. The secret is the password, and it is the part that matters. This page says what happens to it, shows the lines of code that do it, and tells you how to check for yourself. The code below is read from the same build that is serving you this page, build 579b29d3 (2026-11-23).
The short version
- The secret is encrypted on your device before it is saved.
- TabMira's servers never receive it. There is no route on our side that accepts one.
- The app can sign orders with it, but cannot read it back out. Neither can anything else on the page.
- Orders go from your device straight to Binance over a direct connection, carrying a signature, not the secret.
1. The moment you paste it
The text you paste is turned into raw bytes, imported into a signing handle, encrypted, and then the bytes are overwritten with zeros. That last step runs even if something goes wrong along the way, so a rejected key does not sit in memory waiting to be cleaned up.
const bytes = new TextEncoder().encode(secret);
try {
const imported = await importFor(exchange, bytes);
if (imported.key?.extractable) {
throw new Error('refusing to store an extractable signing key');
}
await putCredential({ exchange, keyId, secret: bytes, passphrase, alg: imported.alg, sandbox });
cache.set(exchange, { exchange, keyId, passphrase, sandbox, ...imported });
noteVaultKey(exchange);
} finally {
// Runs on the throw path too. A rejected paste must not leave its bytes
// sitting in a buffer for the garbage collector to get to eventually.
bytes.fill(0);
}
}2. Encrypted before it is saved
What gets written to your device's storage is AES-GCM ciphertext: the secret scrambled with a key, plus a random nonce. The key id and whether it is a practice account are stored readable on purpose, so the app can list your accounts while the vault is locked. The secret itself is only ever inside the ciphertext.
export async function putCredential(input: Credential): Promise<void> {
await ensureRestored();
const key = requireKey();
const iv = crypto.getRandomValues(new Uint8Array(12));
// The passphrase travels inside the same ciphertext as the secret rather
// than in its own field, so a record leaks nothing about whether an exchange
// uses one.
const payload = enc.encode(
JSON.stringify({ secret: Array.from(input.secret), passphrase: input.passphrase ?? null }),
);
const ct = new Uint8Array(await crypto.subtle.encrypt({ name: 'AES-GCM', iv }, key, payload));
payload.fill(0);
const record: StoredCredential = {
exchange: input.exchange,
keyId: input.keyId,
alg: input.alg,
sandbox: input.sandbox,
iv,
ct,
};
await store().put(record);The encryption key is not stored with the ciphertext. It is rebuilt when you unlock, from one of two things only you can produce: your fingerprint or face, through a passkey, or a passcode you type. A copy of your browser's storage, a backup, a synced profile, a stolen phone that is locked: all of those hold ciphertext and a salt, and nothing to open it with.
How the key is derived, both ways
With a passkey, the authenticator produces a value it will only produce after you have verified yourself, and that value goes through HKDF with a per-vault salt.
async function deriveFromBytes(material: Bytes, salt: Bytes): Promise<CryptoKey> {
const base = await crypto.subtle.importKey('raw', material, 'HKDF', false, ['deriveKey']);
return crypto.subtle.deriveKey(
{ name: 'HKDF', hash: 'SHA-256', salt, info: enc.encode('tabmira/vault/aes-gcm') },
base,
{ name: 'AES-GCM', length: 256 },
false,
['encrypt', 'decrypt'],
);
}With a passcode, PBKDF2 at 600,000 rounds. Slow on purpose, so guessing is expensive.
async function deriveFromPasscode(passcode: string, salt: Bytes): Promise<CryptoKey> {
const base = await crypto.subtle.importKey('raw', enc.encode(passcode), 'PBKDF2', false, ['deriveKey']);
return crypto.subtle.deriveKey(
{ name: 'PBKDF2', hash: 'SHA-256', salt, iterations: PBKDF2_ITERATIONS },
base,
{ name: 'AES-GCM', length: 256 },
false,
['encrypt', 'decrypt'],
);
}3. The app can sign with it, not read it
When you unlock, the secret is decrypted just long enough to hand it to the browser's built-in crypto, which keeps it as a signing handle. The false in the last line marks it non-extractable. The app can ask that handle to sign something. It cannot ask for the secret back, and nothing else running on the page can either. Then the decrypted bytes are zeroed, the same as at paste time.
export async function importHmacKey(
secret: string,
hash: 'SHA-256' | 'SHA-384' | 'SHA-512',
decodeBase64 = false,
): Promise<CryptoKey> {
const raw = decodeBase64 ? b64Decode(secret) : enc.encode(secret);
return crypto.subtle.importKey('raw', raw, { name: 'HMAC', hash }, false, ['sign']);
}4. Orders go straight to Binance
The app opens a WebSocket from your device to Binance. If you connected a practice account that is Binance's testnet; otherwise it is Binance itself. There is no TabMira server in between: the address is one or the other, and the socket is your browser's own.
const sandbox = requiredSandbox(id) ?? opts?.sandbox ?? false;
const url = sandbox ? TESTNET_WS : VENUES[id]?.wsUrl;
if (!url) {
throw new ExchangeError(id, 500, 'no_endpoint', `no WebSocket endpoint is configured for ${id}`);
}
const cacheKey = `${id}:${cred.keyId}:${sandbox ? 'test' : 'live'}`;
let client = clients.get(cacheKey);
if (!client) {
client = new BinanceWsClient({ url, cred: { keyId: cred.keyId, key: cred.key } }); const make = this.opts.socketFactory ?? ((u: string) => new WebSocket(u));Each order is signed by the handle from step 3. What travels to Binance is your API key (the username), a timestamp, and the resulting signature. The secret is not in the message, and Binance checks the signature against the copy of the secret it already holds.
private async sign(params: Record<string, string | number>): Promise<string> {
const payload = Object.keys(params)
.sort()
.map((k) => `${k}=${params[k]}`)
.join('&');
const sig = await crypto.subtle.sign('HMAC', this.opts.cred.key, enc.encode(payload));
return toHex(new Uint8Array(sig));
} if (opts.signed) {
clean.apiKey = this.opts.cred.keyId;
clean.timestamp = Date.now() + Math.round(clockOffsets.get(this.opts.url) ?? 0);
clean.signature = await this.sign(clean);
}
const id = `t${++this.seq}`;
const frame = JSON.stringify({ id, method, params: clean });Staying unlocked
Unlocking for every order made the feature unusable, so once you unlock, the app remembers it for up to a week. Be clear about what that means: during that time the unlock key is kept by the browser, as another non-extractable handle, next to the ciphertext it opens. Someone holding your unlocked phone can place an order the same way you can, which is the same bargain every banking app makes, and it leans on your phone's own lock screen for the rest. Pressing Lock deletes that remembered key immediately rather than letting it expire.
export function lockVault(): void {
sessionKey = undefined;
sessionMethod = undefined;
restoring = undefined;
// Deleted, not left to expire. Lock means locked now, and a stored session
// that outlived the button that dismissed it would be the worst kind of
// surprise.
void store().remove(SESSION_ID).catch(() => {});
if (autoLockTimer) clearTimeout(autoLockTimer);
autoLockTimer = undefined;
for (const listener of lockListeners) listener();
}Check it yourself
You do not have to take any of the above on trust. On a computer, open tabmira.com in Chrome, connect a Binance practice key, then press F12 to open the developer tools.
- Network tab. Tick "Preserve log", then place a practice order. Type your secret into the filter box at the top. Zero requests match: it was not sent anywhere. Now filter by
tabmira.com: everything to us is page files, prices and charts, plus a short note per order saying whether it went through (and one when an account is connected, its balances first load, a cancel fails or the connection to the exchange keeps failing): the exchange's name, practice or real, how the request went (phone app, browser or relay), Android, iPhone or browser, which step it was on, and for a refusal the exchange's reason with markets and numbers taken out, its error code and the HTTP status, and for an order its size as a rough range in dollars. No exact amounts, prices, markets or keys. Filter byWS, click the Binance connection, open Messages: each order carriesapiKey,timestampandsignature. - Application tab. Under Storage, open IndexedDB, then
tabmira-trading, thenvault. Your Binance entry is there:keyIdreadable,ctandivas blocks of bytes. Search the whole Application tab for your secret. It is not there. - Console tab. Anything that can be read from the page can be read here, and the signing handle is not. A key imported with
extractable: falsemakescrypto.subtle.exportKeythrow, which is the browser enforcing step 3 rather than us promising it.
If you want to go further, route your phone through a proxy such as mitmproxy and watch every byte that leaves it. The secret appears in none of them.
What this does not protect against
We would rather say this here than have you find out.
- Malware or a bad browser extension while the app is unlocked. Code running inside the page at that moment can place an order the same way the app does. Encryption cannot stop that; nothing available in a browser can. Locking narrows the window and does not close it.
- A key that can do more than it should. We refuse to store a key that can withdraw, and we ask the exchange about it when you connect. Still, make the key yourself with only Spot Trading enabled, and restrict it to your IP address where Binance lets you.
- The pasted text itself. JavaScript cannot wipe a string once it has been typed into a page. The bytes we make from it are zeroed; the string you typed lives until the browser gets round to collecting it.
What about Coinbase?
Coinbase does not allow a browser to talk to it directly, so a Coinbase key is never stored on your device at all. It goes into a small relay that the app sets up inside your own Cloudflare account, which only you control. The connect screen walks through that.
The whole files
Every excerpt above links to its line in the full file. The files themselves, unedited, from this build:
- The vault832 lineslib/trading/vault.tsEncrypts your secret on the device and decides what can unlock it.
- The keystore531 lineslib/trading/keystore.tsTurns a stored secret into a signing handle the app can use but not read.
- Key import239 lineslib/trading/keys.tsImports each exchange’s key format into the browser’s crypto, non-extractable.
- Request signing258 lineslib/trading/sign.tsSigns requests with the handle. Never sees a secret as text.
- Binance adapter621 lineslib/trading/adapters/binance.tsDecides which Binance an order goes to, the practice testnet or the real one.
- Binance connection493 lineslib/trading/binanceWs.tsThe direct line from your device to Binance that orders travel on.
Found something that contradicts this page? Write to [email protected]. See also the privacy policy.