Git Product home page Git Product logo

crypto-incognito's Introduction

Crypto Incognito Node.js / TypeScript Official Library

Node.js CI codecov

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/

Prerequisite

To use this library, you need to build and install libepir. Please follow the instructions on the GitHub repository.

Install

From Git

$ git clone https://github.com/EllipticPIR/crypto-incognito.git
$ cd crypto-incognito
$ npm ci

From NPM

$ npm install crypto-incognito

Usage

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.