<commit_before>The status chain
================

Pyledger does not use a blockchain or any similar protocol because its not
distributed nature makes it very unefficient. The internal storage for every
contract is not divided in blocks, and each state is stored as soon as it is
sent to the server.

One of the important features of the blockchain is that it is impossible for
anyone, even the owner of the data, to tamper with its contents. Pyledger
also has this feature, but in a slightly different fashion. All the statuses
stored in the ledger for every contract are hashed with te previous hash and
the date and time of insertion.

All the hashes are secure, using a SHA-256 for which no collision has been
found yet, which is the same as the used by Bitcoin. This means that one can
verify that noone has been tampering with the backend database that stores
the statuses. We can use the *verify* command of the client to check that the
greeter smart contract works as expected::

    (env) $> pyledger-shell
    PyLedger simple client
    (http://localhost:8888)> call Hello say_hello Guillem
    Hello Guillem for time #2
    (http://localhost:8888)> verify Hello
    'Contract OK'
<commit_msg>Added an important comparison for the status chain.<commit_after>The status chain
================

Pyledger does not use a blockchain or any similar protocol because its not
distributed nature makes it very unefficient. The internal storage for every
contract is not divided in blocks, and each state is stored as soon as it is
sent to the server.

One of the important features of the blockchain is that it is impossible for
anyone, even the owner of the data, to tamper with its contents. Pyledger
also has this feature, but in a slightly different fashion. All the statuses
stored in the ledger for every contract are hashed with te previous hash and
the date and time of insertion. This is a kind of *status chain* instead of a
block chain.

All the hashes are secure, using a SHA-256 for which no collision has been
found yet, which is the same as the used by Bitcoin. This means that one can
verify that noone has been tampering with the backend database that stores
the statuses. We can use the *verify* command of the client to check that the
greeter smart contract works as expected::

    (env) $> pyledger-shell
    PyLedger simple client
    (http://localhost:8888)> call Hello say_hello Guillem
    Hello Guillem for time #2
    (http://localhost:8888)> verify Hello
    'Contract OK'

{'fraction_non_alphanumeric': 0.04878048780487805, 'fraction_numerical': 0.009596161535385846, 'mean_word_length': 4.127049180327869, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2809750', 'n_tokens_mistral': 646, 'n_tokens_neox': 619, 'n_words': 399}