Pesquisar neste blogue

quarta-feira, 20 de dezembro de 2017

When we didn't call it a blockchain




Blockchain seems to be one of the buzz words in the tech world right now - at WebSummit 2017 for sure one of the 3 top words i retained - and some hope with a bright future ahead.
For the non tech it's the way bitcoin works.
Trying to learn more about the technology i came across Learn Blockchains by making one.
And a sentence resonated with something i had done in the past
At this point, the idea of a chain should be apparent—each new block contains within itself, the hash of the previous Block
SAFT-PT (Standard Audit File for Tax purposes Portuguese Version) uses this method to easily identify and verify the correctness of a series of invoices and other tax related documents.
Part of my first job was implementing this on what was then OpenERP (now Odoo) in order to get the program certified by the DGCI (Portugal's main Institute of tax related matters). If you wish to take a closer look at file's structure it is available at SAFT-PT XSD.

Each block is formed by
  • InvoiceDate
  • SystemEntryDate
  • InvoiceNo
  • GrossTotal
  • Hash (hash of the former document thus creating a chain)

DGCI supplies a validator for the file given the public key and the SAFT-PT file.
On any invoice you will find a sequence of 4 characters (corresponding to the 1º, o 11º, o 21º e o 31º digits of the store signature) followed by the name of the certified company.
If you use Odoo and wish to take a look at a base implementation it can be found here - Odoo SAFT-PT- it is not complete and but it should be nice as a basis for a complete implementation.


PS: This article is also available at my LinkedIn.

Sem comentários:

Enviar um comentário