Hash Chain
VeriFactu · Hash Chain
Hash Chain Deep Dive
Section titled “Hash Chain Deep Dive”The VeriFactu hash chain ensures data integrity and chronological ordering.
SHA-256 Algorithm
Section titled “SHA-256 Algorithm”VeriFactu uses SHA-256 (Secure Hash Algorithm 256-bit):
Input: Invoice data + Previous hashOutput: 64-character hex stringChain Construction
Section titled “Chain Construction”First Record
Section titled “First Record”Huella = SHA256( NIF_Obligado + "|" + Num_Serie + "|" + Fecha_Hora + "|" + Importe_Total)Subsequent Records
Section titled “Subsequent Records”Huella = SHA256( NIF_Obligado + "|" + Num_Serie + "|" + Fecha_Hora + "|" + Importe_Total + "|" + Huella_Anterior)Chain Validation
Section titled “Chain Validation”To validate a chain:
- Recompute each hash
- Verify against stored
Huella - Confirm previous hash references
Kreyo Implementation
Section titled “Kreyo Implementation”Kreyo automatically:
- Maintains your chain state
- Computes hashes correctly
- Handles chain breaks (rare edge cases)
- Validates before submission