Crypto Incognito is a web service that serves the Bitcoin's UTXO set database with full anonymous access.
Try online WebAssembly demo (needs API keys): https://demo.crypto-incognito.com/
To use this library, you need to build and install libepir. Please follow the instructions on the GitHub repository.
$ git clone https://github.com/EllipticPIR/crypto-incognito.git
$ cd crypto-incognito
$ npm ci
$ npm install crypto-incognito
Before continue to the next step, please create your own account at our website and create a API key piar (API ID and API secret).
The following code snippet may describe the usage of our library.
import CryptoIncognito from 'crypto-incognito';
const apiID = 'YOUR_API_ID';
const apiKey = 'YOUR_API_KEY';
const address = 'ADDRESS_TO_RETRIEVE';
(async () => {
const ci = new CryptoIncognito(apiID, apiKey);
await ci.init();
const utxos = await ci.findUTXOs(address);
console.log(utxos);
})();
To test the API, you can use the bench_balance.ts.
$ export CI_API_ID=".."
$ export CI_API_KEY=".."
$ ts-node ./src/bench_balance.ts $CI_API_ID $CI_API_KEY "ADDRESS"
ci.findUTXOs()
will conduct an interpolation search into our UTXO database to find out the location (index)
of UTXOs matching the specified address, and then fetch the UTXO body (txid
, vout
, value
) from the server.
The computation may take tens of seconds to complete. Please be patient.