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=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.221.80] (unknown [182.2.68.109]) by gnuweeb.org (Postfix) with ESMTPSA id 4FA5B7E7F8; Wed, 15 Jun 2022 09:42:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1655286178; bh=aw6vepwYZEn5TqLiJPqvPE//Yq1fuppcBHdPVu2fR/E=; h=Date:To:References:From:Subject:In-Reply-To:From; b=CRkqMTpxo2tbQ5EYO9XXTy0fXT4RajpEetrsXlkHVFNIVuP6bB9UxYENqxAkuSsZL PI46RJd9X9fyc8hwL9A6xq8T8vvDWVh1NDdckwpoI+jHwiUoEAVJ1UMqrKxsupojQo uM7Op5lRhFxKAq+DB6C/IkVcMfBwPefWVyf5uDL7gYinvooFFmF1x1IAFVf89mDhCZ ZFn3K2HT1Grh8qnOE8NaM6dcqcUWycN6lKRofEJL4RFzm8pcu9V70oah8nJIhNvusK eKPgSm0SZ4nS6dBt9yxZXW5Tb/7JXlPbg713F+iBCUGubFD2eOPxEFLbOeVizgkFeg AYfDzcGTef8pA== Message-ID: <1dc7ad7c-914a-001c-1d7c-fc8433e9b609@gnuweeb.org> Date: Wed, 15 Jun 2022 16:42:53 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US To: Alviro Iskandar Setiawan , GNU/Weeb Mailing List References: From: Ammar Faizi Subject: Re: [RFC] GNU/Weeb Financial Transaction Record Design In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 6/15/22 4:21 PM, Alviro Iskandar Setiawan wrote: > 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! Hi Al, I like the idea of chaining the transaction ID to make the history consistent and immutable. Overall it looks good to me, let's discuss this further. Several questions below: 1) What are the exact fields we are going to save? 2) How do we maintain a new field in the future if we ever add more? 3) How do we distribute the trusted chains to public? For no (2), you must not break the old records that don't have the new field. For no (3), I think it's quite simple, just post the transaction history record periodically to the group. We can use a Telegram bot for that. Comment? [ Anyway, you can start writing the code. ] -- Ammar Faizi