Getting Started
Welcome to zkDatabase, a cutting-edge NoSQL database designed by Orochi Network to provide provable data integrity utilizing Zero-Knowledge Proofs (ZKP). This guide will help you get started with setting up and using zkDatabase.
Requirement
Before you begin, ensure you have the following:
-
Hardware: A machine with at least 8GBs of RAM.
-
Operating System: Linux, macOS, or Windows.
-
Dependencies:
- Node.js(v18 or later)
- npm (v10 or later) or Yarn (legacy mode)
o1js
package,^1.9.1
is recommendedmina-signer
package3.0.7
or Auro Wallet
A basic understanding of Zero-Knowledge Proofs (ZKP), the o1js
library, and NoSQL databases
Installation
zkDatabase SDK is provided as a npm package, you need to install the zkDatabase SDK in your project:
npm install zkdb
or
yarn add zkdb
This command initializes your project with the necessary dependencies to interact with zkDatabase as a Service.
Start using zkDatabase
Setup your credentials
zkDatabase support both node
and browser environment
, in browser you may need to install the wallet that support Mina Provider like Auro Wallet. In Node.js
you have to specify the private that's generated by mina-singer
:
import Client from "mina-signer";
const minaSigner = new Client({
network: "testnet",
});
console.log(minaSigner.genKeys().privateKey);
Result:
EKFTciRxyxshZjimay9sktsn7v5PvmC5zPq7q4JnitHUytxUVnFP
Connect to zkDatabase endpoint
To start interacting with zkDatabase you must connect to its endpoint. You can do this by providing the necessary credentials such as username, private key, environment, and URL.
import { ZkDatabase } from 'zkdb';
const zkdb = await ZkDatabase.connect({
userName: "chiro-user",
privateKey: "EKFTciRxyxshZjimay9sktsn7v5PvmC5zPq7q4JnitHUytxUVnFP",
environment: "node",
// This URL is for test environment
url: "https://api.zkdatabase.org/graphql",
});
From now on, assumed that we have an instance of zkDatabase and it called zkdb
.