diff options
authorThomas Bracht Laumann Jespersen <>2022-09-20 14:14:51 +0200
committerThomas Bracht Laumann Jespersen <>2022-09-20 14:14:51 +0200
commitdae7ab43fa7b26c30de8547c0871132e10365003 (patch)
parent8d4c203859f37b414b6a9d78237bfa9c9f10697c (diff)
ani: update note on hashes
1 files changed, 24 insertions, 6 deletions
diff --git a/site/ani/ b/site/ani/
index 63ee0d4..345d8b8 100644
--- a/site/ani/
+++ b/site/ani/
@@ -3,7 +3,7 @@
Posted on <b><time id="post-date">2022-08-23</time></b>.
<p id="post-excerpt">
-Quick note on hashes in Pijul
+Quick note on hashes in Pijul.
All hashes in Pijul are [blake3]( which is
@@ -14,15 +14,33 @@ tree which serves our purposes nicely.
A blake3 hash could be represented like this:
- $ echo foo | b3sum | xxd -cols 32 -g 32 | awk '{print $2}'
+ $ echo foo | blake3sum | xxd -cols 32 -g 32 | awk '{print $2}'
but instead the Pijul authors have decided to base32-encode the bytes (without
- $ echo foo | b3sum | base32 | tr -d '='
+ $ echo foo | blake3sum | base32 | tr -d '='
-I believe that the encoding alphabet is actually the
-[Crockford]('s_Base32) alphabet,
-but so far I've been able to decode hashes with the default alphabet.
+An additional feature is that hashed that are base32-encoded include a marker to
+indicate the hashing algorithm. At the moment the possible hashes are limited to
+ enum Hash {
+ None, // The hash of the "null change"
+ Blake3([u8; BLAKE3_BYTES]),
+ }
+The "null change" is essentially a "root commit" that kind of bootstraps the
+dependency graph. All other changes are hashed with blake3. To distinguish
+between the two in change files, the base32 encoding of hashes to the change
+file name appends a single byte to indicate the hash variant used. For the null
+change this is a zero byte, for blake3 it's a `1u8`. Generating the change file
+name ends up something like this:
+ $ BLAKE3_HASH="\x1"
+ $ echo -n "$(echo foo | blake3sum)${BLAKE3_HASH}" | base32 | tr -d '='
+As a side effect all change files with blake3 hash end with the letter `C`.