BBDD with Wallets

One of the features I like most about blockchain is the ability to perform the functions of a transparent, decentralized database.

I understand that the word blockchain is tied to the word finance, although I try to see blockchain always avoiding finance in my mind.

Since I started playing with the Ergo blockchain, I try to build while avoiding the traditional database. Although the function that the identifiers have in the database seems incredible to me.

BBDD with Wallets

The other day I was thinking and making some sketches to replicate a traditional database using wallets and tokens. Here's an example, let me explain better....

Imagine 1 database containing a table for your clients.

Table Clients

  • id_client
  • name_client
  • tlf_client

If we take this table to a wallet with tokens it would look like this.

Table with wallet and tokens

I create a wallet and as many tokens as I need. In this example I will create a table with 3 clients.
Wallet 1 is the Clients table and 3 tokens are 3 clientes.

From each token I have to get the amount of tokens I need to relate to other tables. Since the token ID will act as a customer identifier and will need to be sent to the tables of orders, discounts, credits…
So I have created these 3 tokens.

To create a table of orders and relate it to a specific customer, we would only have to create a new wallet for orders and send 1 token of the customer to whom those orders will belong. This wallet would become a table with all the orders of a given customer. Each order would be another token (if we believe that this order could be related to another new table in the future, an amount greater than 1 will be created to send it to the new related wallet).

It would look something like this.


2 Likes

I like this idea really good work. Since some database entries would need to be kept private how could we protect from someone viewing the data in a block explorer by knowing the wallet ID?

Thanks, glad you like it!

For records that should not be public you could encrypt the title and token description.
Here you can see an example of token encryption.

1 Like