Reserva is a functional central bank digital currency (CBDC) running on top of the SingleStore database. It is written in the Go programming language and exposes its functionality via a REST API.
Reserva is a stateless web server, and thus is horizontally scalable, and suitable for deployment in containers.
You can read more about Reserva at my website's blog.
All routes require bearer token authentication unless otherwise noted.
Any bank that is given "admin" permissions has the ability to change the money supply, which makes it a "central bank" in traditional economic terms.
-
POST
- Creates a new bank
- Requires admin token
{ "username": <string>, "admin": <boolean> }
{ "username": <string>, "admin": <boolean> }
-
GET
- Gets the bank's info
- Requires bank's token, or admin token
GET
with no query parameters.{ "username": <string>, "admin": <boolean> }
-
POST
- Creates an account
{ "metadata": <object> }
{ "id": <number>, "metadata": <object>, "bank_username": <string>, "frozen": <boolean>, "balance_in_cents": <number> }
-
GET
- Gets an account's info
GET
with no query parameters.{ "id": <number>, "metadata": <object>, "bank_username": <string>, "frozen": <boolean>, "balance_in_cents": <number> }
-
PATCH
- Changes the account's balance, which alters the total money supply.
- Requires admin token
{ "id": <number>, "amount_in_cents": <number> }
{ "id": <number>, "metadata": <object>, "bank_username": <string>, "frozen": <boolean>, "balance_in_cents": <number> }
-
PATCH
- Changes account's KYC data.
{ "id": <number>, "metadata": <object> }
{ "id": <number>, "metadata": <object>, "bank_username": <string>, "frozen": <boolean>, "balance_in_cents": <number> }
-
PATCH
- Freezes or unfreezes an account.
{ "id": <number>, "frozen": <boolean> }
{ "id": <number>, "metadata": <object>, "bank_username": <string>, "frozen": <boolean>, "balance_in_cents": <number> }
-
POST
- Create a new transfer.
{ "source_account_id": <number>, "target_account_id": <number>, "amount_in_cents": <number> }
{ "id": <number>, "created_at": <string...RFC 3339> "source_account": <number>, "target_account": <number>, "amount_in_cents": <number> }
-
POST
- Create an authentication token
{ "email": <string>, "password": <string> }
{ "token": <string> }
GET
- A healthcheck
GET
- Get system info