Hacker News new | ask | show | jobs
by icebraining 2961 days ago
Sure, you hash(transaction info + hash of previous transaction) and sign that with a private key, and you store it as a text field in the database.

In my country, all invoicing software must implement that (it's part of the SAF-T format that we must deliver to the IRS), and it took us less than ten lines of Ruby to do it. It's literally concatenating a few strings, then using some crypto library to hash and sign it.

Verification is just doing the same process, then checking if the signed hashes match.