Skip to content

Instantly share code, notes, and snippets.

@wilsonianb
Last active April 16, 2020 21:32
Show Gist options
  • Save wilsonianb/b164080a6c1b62e0e2be11d41efb8b13 to your computer and use it in GitHub Desktop.
Save wilsonianb/b164080a6c1b62e0e2be11d41efb8b13 to your computer and use it in GitHub Desktop.
Proposed STREAM Receipt ASN.1 OER
StreamReceipt ::= SEQUENCE {
streamId VarUInt,
receipt Receipt
}
RECEIPT ::= CLASS {
&typeId UInt8 UNIQUE,
&Type
} WITH SYNTAX {&typeId &Type}
ReceiptSet RECEIPT ::= {
{1 ReceiptV1}
}
Receipt ::= SEQUENCE {
type RECEIPT.&typeId ({ReceiptSet}),
-- NON-Length-prefixed data
data RECEIPT.&Type ({ReceiptSet}{@type})
}
ReceiptV1 ::= SEQUENCE {
nonce UInt128,
streamId UInt8,
totalReceived UInt64,
-- HMAC-SHA256 using a 32 byte Secret
-- The message is the concatenation of the 1 byte type/version (always 1) and all other fields,
-- in the order listed above
hmac UInt256
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment