Skip to content

Instantly share code, notes, and snippets.

@wilsonianb
Last active April 13, 2020 18:23
Show Gist options
  • Save wilsonianb/75ddc1b2a3780218016f1da0f28f9101 to your computer and use it in GitHub Desktop.
Save wilsonianb/75ddc1b2a3780218016f1da0f28f9101 to your computer and use it in GitHub Desktop.
Proposed STREAM Receipt ASN.1 OER
StreamReceipt ::= SEQUENCE {
-- Identifier of the stream
streamId VarUInt,
-- Length-prefixed Receipt for verifying the total amount received on this stream
-- The sender is not expected to decode the Receipt fields but must be able to decode the
-- receipt string in the frame, even if it represents an unsupported Receipt version
receipt Receipt
}
Receipt ::= CHOICE {
receiptV1 ReceiptV1
}
ReceiptV1 ::= SEQUENCE {
-- Always 1
version UInt8,
-- Identifier of the connection
nonce UInt128,
-- Identifier of the stream
streamId UInt8,
-- Total amount the stream has received so far
totalReceived UInt64,
-- HMAC-SHA256 using a 32 byte Secret
-- The message is the concatenation of 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