# HollowDB-as-a-Service

HollowDB is an open-source project, however due to the nature of working with a blockchain in the background, setting up your own project comes with a slight overhead.

* If you are using a backend, you will have to manage a wallet to do the transactions.
* If you are using Bundlr, you need to fund your Bundlr wallet.
* You might have to do some tricks to improve your performance, to avoid waiting for transaction confirmations and such.
* Or, you simply do not do any of the above, and use HollowDB-as-a-service.

The purpose of our service is to provide a web2-like key-value database, abstracting away all the web3-like problems of wallet managements and blockchain TPS limitations. All that is left for the user is to create an API-key, and start using the key-value database.

See our website here:

{% embed url="<https://hollowdb.xyz/>" %}

## HollowDB Client

We provide an NPM package to get you started with our service.

{% embed url="<https://github.com/firstbatchxyz/hollowdb-client>" %}
HollowDB Client
{% endembed %}

### Installation

HollowDB client is an NPM package. You can install it as:

```sh
yarn add hollowdb-client    # yarn
npm install hollowdb-client # npm
pnpm add hollowdb-client    # pnpm
```

### Usage

Create a new client with:

```ts
client = await HollowClient.new({
  apiKey: 'your-api-key',
  db: 'your-database-name',
});
```

After that, using the client is as simple as it gets:

```ts
// without zero-knowledge proofs
await client.get(KEY);
await client.put(KEY, VALUE);
await client.update(KEY, VALUE);
await client.remove(KEY);
```

If you are connecting to a database that has zero-knowledge proof verifications enabled, you will need to provide proofs along with your requests.

You can use our [HollowDB Prover](https://github.com/firstbatchxyz/hollowdb) utility to generate proofs with minimal development effort. Assuming that a proof is generated for the respective request, the proof shall be provided as an additional argument to these functions.

```ts
// with zero-knowledge proofs
await client.get(KEY);
await client.put(KEY, VALUE);
await client.update(KEY, VALUE, PROOF);
await client.remove(KEY, PROOF);
```

See more about the prover utility here:

{% content-ref url="/pages/ViDpsKGJx3yRvHSW6rhL" %}
[HollowDB Prover](/zero-knowledge-proofs/hollowdb-prover.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hollowdb.xyz/hollowdb/hollowdb-as-a-service.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
