summaryrefslogtreecommitdiff
path: root/design-documents/018-contract-json.rst
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-06-22 19:34:47 +0200
committerChristian Grothoff <christian@grothoff.org>2021-06-22 19:34:47 +0200
commit555a18f735324a0d7829262529124b029098340d (patch)
treeaeaa5d6aef29c280209dea44d3141e7bce54c3d6 /design-documents/018-contract-json.rst
parent1c356f81ea3051aa443e61e951aace709e90d25d (diff)
parentf47314fe9460324d5bf331d0dc71d5358c6d8e08 (diff)
downloaddocs-555a18f735324a0d7829262529124b029098340d.tar.gz
docs-555a18f735324a0d7829262529124b029098340d.tar.bz2
docs-555a18f735324a0d7829262529124b029098340d.zip
Merge branch 'dd13'
Diffstat (limited to 'design-documents/018-contract-json.rst')
-rw-r--r--design-documents/018-contract-json.rst36
1 files changed, 35 insertions, 1 deletions
diff --git a/design-documents/018-contract-json.rst b/design-documents/018-contract-json.rst
index 4208febc..2162d6ed 100644
--- a/design-documents/018-contract-json.rst
+++ b/design-documents/018-contract-json.rst
@@ -102,7 +102,7 @@ member of the parent object.
},
}
- =>
+ =>
{
...props,
@@ -146,6 +146,40 @@ resulting bytes are terminated with a single 0-byte and then hashed with
SHA512.
+Test vector
+-----------
+
+The follwing input contains top-level and nested forgettable
+fields, as well as booleans, integers, strings and objects
+as well as non-forgettable fields. It is thus suitable as
+a minimal interoperability test:
+
+.. code-block:: json
+
+ {
+ "k1": 1,
+ "_forgettable": {
+ "k1": "SALT"
+ },
+ "k2": {
+ "n1": true,
+ "_forgettable": {
+ "n1": "salt"
+ }
+ },
+ "k3": {
+ "n1": "string"
+ }
+ }
+
+Hashing the above contract results in the following Crockford base32 encoded
+hash
+``287VXK8T6PXKD05W8Y94QJNEFCMRXBC9S7KNKTWGH2G2J2D7RYKPSHNH1HG9NT1K2HRHGC67W6QM6GEC4BSN1DPNEBCS0AVDT2DBP5G''.
+
+Note that typically the salt values must be chosen at random, only for this test we use static salt values.
+
+
+
Discussion / Q&A
================