From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by gnuweeb.org (Postfix) with ESMTPSA id C7D947EC56 for ; Wed, 15 Jun 2022 09:21:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1655284881; bh=2glfxLqFTIeaLZqCdO5vXPgeR5n9DjCkeoPvtvWPFtE=; h=From:Date:Subject:To:Cc:From; b=j8lf4YM5J4an3Mh0FO+zSbGwGL4Ny9kTOiAuLo89/kyYLlX3Ro8pD+pFfG+Jcg0V7 feyINzO73LnW9TqCYc3uiSWw5BpMU2DqPSJOElfqbhJ/yrsKsYJkzz8uBR2Rqft/Gt SAvU3pf6jIEMJcrZwJZvzjyTaqDOoT4m+dKYNp3/DhFtwAp4tYmVqMQ698GbH8d0NV i0TquxUUPm3+an1Q57wxL+xOl5E4tHWTzG/87VznKU3kDGOTZyfWKhPsnNQjuRLIgN M242fSK6hlRuqq4ua80W/ccRoSd4e4cyg86zZf7Xb16hVMt6V7YWWSanH3YpM4XeVg PutSHmENujFgQ== Received: by mail-lj1-f174.google.com with SMTP id y29so12542240ljd.7 for ; Wed, 15 Jun 2022 02:21:21 -0700 (PDT) X-Gm-Message-State: AJIora+2DK0gG8HmX4WlWpVt4UB+N9JYvk0XLAXSw6jKzP/f5NZMNCv0 Ux/Mlb1jufWSp7QQJ2WMTJa2uJUIF1d3FS1YzXQ= X-Google-Smtp-Source: AGRyM1vCFeWzz/f9G9EBKYmUM4BCQtTBgl/MMk5Yg8V78k3+VVbyYuHH+a1zUSm3zrNcFIatspuhHUXcEl5OiEZG9cA= X-Received: by 2002:a2e:a783:0:b0:255:9c25:cd36 with SMTP id c3-20020a2ea783000000b002559c25cd36mr4711717ljf.209.1655284879903; Wed, 15 Jun 2022 02:21:19 -0700 (PDT) MIME-Version: 1.0 From: Alviro Iskandar Setiawan Date: Wed, 15 Jun 2022 16:21:08 +0700 X-Gmail-Original-Message-ID: Message-ID: Subject: [RFC] GNU/Weeb Financial Transaction Record Design To: "GNU/Weeb Mailing List" Cc: Ammar Faizi Content-Type: text/plain; charset="UTF-8" List-Id: 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