# Introduction Mine ZEC through your browser. Built via ponsdotfamily. ## The protocol Zponk brings wallet connection, a browser search engine, and proof verification into one desk. Open the desk, connect your wallet, and authorize a round before starting the search. ## The engine WebGPU runs the search on a compatible graphics device. CPU mode is available when WebGPU cannot be used. Power changes the balance between work and pauses; it is not a device utilization reading. ## The network The web wrapper uses ZEC on Robinhood Chain, chain ID 4663. Its SHA-256 challenges are separate from native Zcash block validation. Zponk token CA: SOON. ## Run the examples The code in these docs is JavaScript for an HTTPS browser console. Each block is independent. Examples inspect browser capabilities, read a wallet connection, or calculate local values. They do not open mining rounds or submit proofs. The SHA-256 example uses a fixed test input, not a live challenge. Wallet examples use window.ethereum when an injected wallet exposes it; use the site wallet picker for other connection methods. ## Related reading - [The desk](/docs/mine) - [Wallet connection](/docs/wallet) - [Browser support](/docs/browser) - [SHA-256 in the browser](/docs/sha256) --- # The desk Connect, choose an engine, and watch the search. ## Connect Open /mine and connect through the wallet picker. Switch to Robinhood Chain when prompted. Starting a round asks for a message signature; this step is not a token approval. If you decline, the search does not start. ## Choose an engine Select GPU for WebGPU or CPU for the CPU search. If GPU mode cannot get a usable WebGPU engine, the desk may fall back to CPU and display a notice. A device name alone does not prove that WebGPU is available. ## Set the power The desk offers 40, 75, and 100 Power. Lower settings leave more time between batches. The value is a workload setting, not a measurement of GPU load. Use Stop to end the active search. ## Read the session Hashrate is the measured number of attempts per second. Candidate keys and hash previews show the current search. A local match still needs server verification. This is the rate formatter used by the desk, shown as standalone JavaScript: ```javascript function rateLabel(rate) { if (rate >= 1000) return `${(rate / 1000).toFixed(1)} kH/s`; return `${Math.round(rate)} H/s`; } console.log(rateLabel(200000)); // 200.0 kH/s console.log(rateLabel(850)); // 850 H/s ``` ## Related reading - [Performance](/docs/performance) - [Troubleshooting](/docs/troubleshooting) --- # The key Wallet-bound SHA-256 proof of work. ## The challenge A round belongs to a wallet and includes a fresh challenge. The browser searches candidate nonces and hashes their encoded input. Changing the input changes the hash; a displayed key is a search value, not a wallet private key. ## Display a candidate The client represents a nonce as padded hexadecimal text. This is the client formatter with a fixed example value. It does not create a round or submit a candidate. ```javascript const KEY_LENGTH = 40; function nonceKey(nonce) { return nonce.toString(16).padStart(KEY_LENGTH, '0'); } console.log(nonceKey(42)); // 000000000000000000000000000000000000002a ``` ## Finding a match A candidate must satisfy the active round target. Repeating the same input repeats the same hash. More attempts do not make a match due at a particular time. ## Verification The desk sends a found candidate for verification. A local hash alone is not confirmation that a round has completed. Follow the desk status and wait for its confirmation before treating a round as complete. These are wrapper challenges, not native Zcash blocks. ## Related reading - [SHA-256 in the browser](/docs/sha256) --- # Wallet connection Read the selected account and understand the signature prompt. ## Connect on the site Use Connect wallet on the mining desk and choose your provider. The wallet asks whether this site may see your selected account. Keep the intended account selected before starting a round. ## Read the connected account For an injected wallet, eth_accounts returns the accounts already exposed to the page. It does not request a signature or a transaction. An empty array means this provider has not exposed an account to this page. Run this after connecting. It reads only the first account and prints a shortened version locally. ```javascript const provider = window.ethereum; if (!provider?.request) { console.log('Use the site wallet picker.'); } else { try { const accounts = await provider.request({ method: 'eth_accounts' }); const address = accounts[0]; console.log(address ? `${address.slice(0, 6)}…${address.slice(-4)}` : 'No account connected.'); } catch { console.log('Wallet connection unavailable.'); } } ``` ## Authorize a round Starting a round opens a wallet message-signing prompt. Review it in the wallet. The desk requires that signature to continue. Never enter a seed phrase or private key into the site or these examples. ## Change accounts Stop the search before changing accounts. Check the newly selected account in the site header, then start a new session. An earlier account connection is not authorization for a different wallet. ## Related reading - [Network](/docs/network) - [Ethereum provider specification](https://eips.ethereum.org/EIPS/eip-1193) --- # Network The web wrapper uses Robinhood Chain, chain ID 4663. ## Check the wallet network The wallet API returns chain IDs as hexadecimal strings. The value for 4663 is 0x1237. This example reads the selected network without switching it. ```javascript const provider = window.ethereum; if (!provider?.request) { console.log('Use the site wallet picker.'); } else { try { const chainId = await provider.request({ method: 'eth_chainId' }); console.log(Number(chainId) === 4663 ? 'Robinhood Chain selected.' : 'Switch to Robinhood Chain in the site.'); } catch { console.log('Cannot read the wallet network.'); } } ``` ## Switch through the desk If the site shows Switch to Robinhood, use that control and approve the network change in your wallet. If you decline, you can try again from the same control. ## Network units The network uses ETH as its native currency. The ETH balance in the wallet header is separate from the ZEC asset used by the wrapper. A ticker alone is not a contract address. Zponk token CA: SOON. ## Zcash and the wrapper The browser searches SHA-256 challenges for the wrapper. It does not validate native Zcash blocks or replace Zcash consensus. Use the chain shown by the site when checking a wallet session. ## Related reading - [Wallet connection](/docs/wallet) - [Chain ID specification](https://eips.ethereum.org/EIPS/eip-695) --- # Browser support Check whether this browser can provide a WebGPU device. ## Use HTTPS WebGPU and Web Crypto require a secure browser context. Open the HTTPS site before running the examples. Browser, operating system, driver, and device support all affect whether an adapter is available. ## Request an adapter Checking navigator.gpu is only the first step. The browser may expose the API but return no adapter. This example requests a device and releases it immediately, without starting a mining job. ```javascript if (!window.isSecureContext || !navigator.gpu) { console.log('WebGPU unavailable. Use CPU mode.'); } else { let device; try { const adapter = await navigator.gpu.requestAdapter(); if (!adapter) { console.log('No WebGPU adapter. Use CPU mode.'); } else { device = await adapter.requestDevice(); console.log('WebGPU device available.'); } } catch { console.log('WebGPU device unavailable. Use CPU mode.'); } finally { device?.destroy(); } } ``` ## CPU mode If the check fails, choose CPU on the desk. A successful check confirms device access now; it does not guarantee a hashrate or that the device will remain available after sleep. ## Keep the tab active Backgrounding the browser, sleeping the device, and power-saving settings can interrupt work. After waking the device, read the desk status before restarting. ## Related reading - [Troubleshooting](/docs/troubleshooting) - [WebGPU adapter reference](https://developer.mozilla.org/en-US/docs/Web/API/GPU/requestAdapter) --- # SHA-256 in the browser Calculate a real SHA-256 digest with the browser Web Crypto API. ## Hash a known input This complete example hashes the UTF-8 text abc. It uses only the standard browser API and runs locally. It is a hash demonstration, not the mining engine or a production proof. ```javascript const bytes = new TextEncoder().encode('abc'); const digest = await crypto.subtle.digest('SHA-256', bytes); const hex = Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, '0') ).join(''); const expected = 'ba7816bf8f01cfea414140de5dae2223' + 'b00361a396177a9cb410ff61f20015ad'; if (hex !== expected) throw new Error('SHA-256 check failed.'); console.log(hex); ``` ## Text and bytes differ A digest depends on the exact bytes. The text 2a is two UTF-8 bytes, while the hexadecimal byte 0x2a is one byte. Text encodings and binary encodings are not interchangeable. ```javascript const textBytes = new TextEncoder().encode('2a'); const binaryBytes = new Uint8Array([0x2a]); console.log(Array.from(textBytes)); // [50, 97] console.log(Array.from(binaryBytes)); // [42] ``` ## Read the output SHA-256 produces 32 bytes. Rendering each byte as two hexadecimal characters gives a 64-character string. Padding preserves leading zeroes. The same bytes always produce the same digest. ## Use the desk for mining The actual desk manages its current challenge and search engine. These examples make no requests to the mining service and do not demonstrate opening or completing a round. ## Related reading - [The key](/docs/mine/key) - [Web Crypto digest reference](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest) --- # Performance Read hashrate without confusing it with device utilization. ## Calculate a rate Hashrate divides completed attempts by elapsed time. This example calculates a rate from two illustrative measurements. It does not benchmark the device or read the live desk. ```javascript function hashesPerSecond(attempts, elapsedMs) { if (!Number.isFinite(attempts) || attempts < 0 || !Number.isFinite(elapsedMs) || elapsedMs <= 0) { throw new RangeError('Use non-negative attempts and positive elapsed time.'); } return attempts / (elapsedMs / 1000); } console.log(hashesPerSecond(500000, 2500)); // 200000 console.log(hashesPerSecond(0, 1000)); // 0 ``` ## Power is a setting The desk inserts pauses between batches. Increasing Power changes the work/rest balance; it does not promise a matching percentage of GPU utilization. Lower Power if you want the browser to leave more room for other work. ## Compare like for like Compare the same engine, Power setting, browser, and device state. Let startup finish before reading the rate. A CPU result and a GPU result describe different execution paths. ## A rate is not a countdown Hashrate measures work, not how soon a valid candidate must appear. Another application using the graphics device, device sleep, and background tabs can change the observed rate. ## Related reading - [The desk](/docs/mine) - [Browser support](/docs/browser) --- # Troubleshooting Resolve wallet, browser, and connection problems from the desk. ## Wallet or signature unavailable Unlock the wallet and check for a pending prompt. Use the site picker if no injected provider is available. If you decline the round signature, press Start again when ready. Check that the selected wallet is on Robinhood Chain. ## WebGPU unavailable Choose CPU, or run the device check on the Browser support page. A GPU name displayed in the interface is not a successful WebGPU device check. After sleep or a graphics reset, stop and restart the search. ## Connection interrupted Read the notice on the desk. If a round is waiting for confirmation, let the status update before starting again. If the desk says new rounds are temporarily unavailable, wait and retry later. This diagnostic prints only browser capability flags. The online flag is a hint from the browser, not a reachability test for the service. ```javascript console.table({ secureContext: window.isSecureContext, webGPU: Boolean(navigator.gpu), webCrypto: Boolean(globalThis.crypto?.subtle), onlineHint: navigator.onLine, visible: document.visibilityState === 'visible', injectedWallet: Boolean(window.ethereum?.request), }); ``` ## Report a problem Include the exact visible error, browser version, selected engine, and the steps that led to it. A cropped screenshot of the error is usually enough. Keep wallet signatures, account details, and raw browser storage out of the report. ## Related reading - [Browser support](/docs/browser) - [Wallet connection](/docs/wallet)