syndicate-protocols/schemas/sturdy.prs

47 lines
1.7 KiB
Plaintext
Raw Normal View History

version 1 .
2021-07-22 12:12:53 +00:00
embeddedType EntityRef.Cap .
2023-02-06 09:45:41 +00:00
; The sequence of Caveats is run RIGHT-TO-LEFT.
; That is, the newest Caveats are at the right.
2023-02-06 15:19:03 +00:00
;
; Let f = HMAC-BLAKE2s, e = canonical machine-oriented serialization of some preserves value,
; and k = the original secret key for the ref.
;
; The `sig` is then f(f(f(f(k, e(oid)), ...), Caveat), ...).
;
2023-02-06 09:45:41 +00:00
SturdyRef = <ref @oid any @caveatChain [Caveat ...] @sig bytes>.
; embodies 1st-party caveats over assertion structure, but nothing else
; can add 3rd-party caveats and richer predicates later
2023-02-06 10:06:02 +00:00
Caveat = Rewrite / Alts / Reject /@unknown any .
Rewrite = <rewrite @pattern Pattern @template Template> .
Reject = <reject @pattern Pattern> .
Alts = <or @alternatives [Rewrite ...]>.
Oid = int .
WireRef = @mine [0 @oid Oid] / @yours [1 @oid Oid @attenuation Caveat ...].
;---------------------------------------------------------------------------
Lit = <lit @value any>.
Pattern = PDiscard / PAtom / PEmbedded / PBind / PAnd / PNot / Lit / PCompound .
PDiscard = <_>.
PAtom = =Boolean / =Float / =Double / =SignedInteger / =String / =ByteString / =Symbol .
PEmbedded = =Embedded .
2021-07-12 19:10:19 +00:00
PBind = <bind @pattern Pattern>.
PAnd = <and @patterns [Pattern ...]>.
PNot = <not @pattern Pattern>.
PCompound =
/ @rec <rec @label any @fields [Pattern ...]>
/ @arr <arr @items [Pattern ...]>
/ @dict <dict @entries { any: Pattern ...:... }> .
2021-06-09 13:06:58 +00:00
Template = TAttenuate / TRef / Lit / TCompound .
2023-02-06 09:45:41 +00:00
TAttenuate = <attenuate @template Template @attenuation [Caveat ...]>.
2021-07-12 19:10:19 +00:00
TRef = <ref @binding int>.
TCompound =
/ @rec <rec @label any @fields [Template ...]>
/ @arr <arr @items [Template ...]>
/ @dict <dict @entries { any: Template ...:... }> .