Rename end_hash to id

This commit is contained in:
Greg Fitzgerald
2018-03-04 07:34:38 -07:00
parent 608def9c78
commit b1e9512f44
8 changed files with 50 additions and 50 deletions

View File

@@ -71,9 +71,9 @@ fn main() {
Running the program should produce a log similar to:
```rust
Entry { num_hashes: 0, end_hash: [0, ...], event: Tick }
Entry { num_hashes: 2, end_hash: [67, ...], event: Transaction { data: [37, ...] } }
Entry { num_hashes: 3, end_hash: [123, ...], event: Tick }
Entry { num_hashes: 0, id: [0, ...], event: Tick }
Entry { num_hashes: 2, id: [67, ...], event: Transaction { data: [37, ...] } }
Entry { num_hashes: 3, id: [123, ...], event: Tick }
```
Proof-of-History
@@ -86,7 +86,7 @@ assert!(verify_slice(&entries, &seed));
```
[It's a proof!](https://en.wikipedia.org/wiki/CurryHoward_correspondence) For each entry returned by the
historian, we can verify that `end_hash` is the result of applying a sha256 hash to the previous `end_hash`
historian, we can verify that `id` is the result of applying a sha256 hash to the previous `id`
exactly `num_hashes` times, and then hashing then event data on top of that. Because the event data is
included in the hash, the events cannot be reordered without regenerating all the hashes.