public inbox for [email protected]
 help / color / mirror / Atom feed
From: Alviro Iskandar Setiawan <[email protected]>
To: "GNU/Weeb Mailing List" <[email protected]>
Cc: Ammar Faizi <[email protected]>
Subject: [RFC] GNU/Weeb Financial Transaction Record Design
Date: Wed, 15 Jun 2022 16:21:08 +0700	[thread overview]
Message-ID: <CAOG64qNV-TnS6yA4fDRBypk1SxyibQT36OheCM83w2HW_NCX8w@mail.gmail.com> (raw)

Hi,

In order to keep the transaction record consistent, we can use a
chaining hash system that generates the transaction ID by using its
parent ID and the current transaction details.

For example, to create a new transaction, we have several things to note, like:

  1. date
  2. description
  3. commiter
  4. amount

  [ other metadata stuff may be included ]

We can then generate the transaction id by using a hash function,
let's say SHA1:

 trx_info = date . description . commiter . amount . parent_trx_id
 trx_id   = SHA1(info)
 SAVE(trx_id, date, description, commiter, amount, parent_trx_id)

Note that since the current trx ID uses its parent trx ID to generate
itself, it makes the situation impossible to rewrite the history
without breaking the whole chain. That's the point of the consistency
in this design. We can verify that the data is consistent by just
re-hashing the transaction info together with its parent trx id.

Also note that, for the first transaction, it doesn't have a parent
trx id. So only the first transaction doesn't use a parent trx id to
generate itself. Let's call it the genesis transaction.

Please comment!

tq

-- Viro

             reply	other threads:[~2022-06-15  9:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15  9:21 Alviro Iskandar Setiawan [this message]
2022-06-15  9:23 ` [RFC] GNU/Weeb Financial Transaction Record Design Alviro Iskandar Setiawan
2022-06-15  9:42 ` Ammar Faizi
2022-06-15 10:00   ` Alviro Iskandar Setiawan
2022-06-15 10:03     ` Ammar Faizi
2022-06-15 10:06       ` Alviro Iskandar Setiawan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOG64qNV-TnS6yA4fDRBypk1SxyibQT36OheCM83w2HW_NCX8w@mail.gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox