| 1 | "#string(blah)" |
|---|
| 2 | blank |
|---|
| 3 | "Reason" |
|---|
| 4 | #key_id(blind_blah) |
|---|
| 5 | #key_identifier_blah |
|---|
| 6 | #key_id_of_DSDB |
|---|
| 7 | #encrypted_serialBLAH |
|---|
| 8 | ISCertificate |
|---|
| 9 | DSDBCertificate |
|---|
| 10 | MINT_CERTIFICATE |
|---|
| 11 | Blind |
|---|
| 12 | ObfuscatedBlind |
|---|
| 13 | Coin |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | Details of the protocol implementation (including messages and containers) |
|---|
| 17 | |
|---|
| 18 | --------------------------------------------------- |
|---|
| 19 | |
|---|
| 20 | The following primitives are used to encode all appropriate details. |
|---|
| 21 | |
|---|
| 22 | #hex_string(foo) encodes the natural integer value of foo as a string. |
|---|
| 23 | The integer value of foo is changed to a base-16 0-9a-f representation in lowercase. |
|---|
| 24 | The value is encoded without leading zeros. |
|---|
| 25 | |
|---|
| 26 | #base64(foo) encodes the natural integer value of foo as a string. |
|---|
| 27 | The integer value of foo is changed to a base-64 representation. |
|---|
| 28 | The actual implementation of this may change, but for now I'm working with the following |
|---|
| 29 | scheme: |
|---|
| 30 | ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!- for the encoding |
|---|
| 31 | and = for padding |
|---|
| 32 | |
|---|
| 33 | #string(foo) places restrictions on the string. The string cannot contain any |
|---|
| 34 | unprintable characters, any control character, or the " character. |
|---|
| 35 | The string cannot begin with a space character |
|---|
| 36 | The string must be ASCII. The string, when encoded, will be placed in a set of ""'s |
|---|
| 37 | e.g. #string(foo) is encoded as "foo" |
|---|
| 38 | |
|---|
| 39 | TIME(foo) encodes a literal time in a strict ISO8601 encoding. The encoding is: |
|---|
| 40 | YYYYMMDDThhmmssZ. |
|---|
| 41 | The character 'T' seperates the two fields between the date and the time. |
|---|
| 42 | The character 'Z' encodes the time zone for the time (which must always be UTC) |
|---|
| 43 | The date is encoded in YYYYMMDD where YYYY is the year, MM is the decimal month (01-12) |
|---|
| 44 | and DD is the day (01-31) |
|---|
| 45 | The time is encoded in hhmmss where hh is the hour (00-23), mm is the minutes (00-59) |
|---|
| 46 | and ss is the seconds (00-60) (60 is only permissiable for leap seconds) |
|---|
| 47 | |
|---|
| 48 | --------------------------------------------------- |
|---|
| 49 | |
|---|
| 50 | The following complex types are built using primitives. |
|---|
| 51 | |
|---|
| 52 | (foo, bar, baz) is a tuple containing foo, bar, and baz. The tuple can be of any length, |
|---|
| 53 | but each message defines the tuple length it is looking for. |
|---|
| 54 | The tuple is encoded as [foo] [bar] [baz]. That is, the value of foo, a single space, |
|---|
| 55 | the value of bar, a single space, and the value of baz. No following spaces are required. |
|---|
| 56 | This primitive is used to allow a concise list defination (see below) |
|---|
| 57 | |
|---|
| 58 | list(foo, bar) is a length-deliminated list. It can be of any length. |
|---|
| 59 | The list is encoded as #hex_string(list_length) [foo] [bar]. That is, the length of the list |
|---|
| 60 | encoded as a hex string and then the elements of the string are given seperated by spaces. |
|---|
| 61 | All types have a length of one, including tuples. |
|---|
| 62 | |
|---|
| 63 | emptylist is a placeholder for a list when no list actually appears. This is only used to give |
|---|
| 64 | a single reason for an action rather than for each element in a list. |
|---|
| 65 | |
|---|
| 66 | strlist(foo, bar, baz) is a list of strings. The strings in the list must follow the same |
|---|
| 67 | restrictions as #string, and have no space characters. The list is encoded as |
|---|
| 68 | #hex_string(list_length) [foo], [bar], [baz] |
|---|
| 69 | |
|---|
| 70 | --------------------------------------------------- |
|---|
| 71 | |
|---|
| 72 | The following containers are built using primitives and additional encoding. |
|---|
| 73 | |
|---|
| 74 | Certificates, blanks, obfuscated blanks, coins are all made up of key=value pairs. |
|---|
| 75 | Some keys are optional and some can be repeated. The exact semantics of which are |
|---|
| 76 | described in protocol-containers.txt. |
|---|
| 77 | |
|---|
| 78 | When the container is encoded, it is encoded with the values in the exact order given |
|---|
| 79 | from protocol-containers.txt. |
|---|
| 80 | |
|---|
| 81 | The encoding is as follows: |
|---|
| 82 | {name=value;name=value;name=value....;name=value} |
|---|
| 83 | |
|---|
| 84 | The encoding of the ContentPart of the container is as follows: |
|---|
| 85 | {name=value;name=value;name=value....;name=value} of only the ContentNames. |
|---|
| 86 | |
|---|
| 87 | [Note: this gives a human readable format while forcing all messages to be on |
|---|
| 88 | a single line] |
|---|
| 89 | |
|---|