You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://developers.libra.org/docs/policies/code-of-conduct) so that you can understand what actions will and will not be tolerated.
3
+
The project has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://developers.diem.com/docs/policies/code-of-conduct) so that you can understand what actions will and will not be tolerated.
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ This project welcomes contributions.
4
4
5
5
## Contributor License Agreement (CLA)
6
6
7
-
For pull request to be accepted by any Libra projects, a CLA must be [signed](https://libra.org/en-US/cla-sign). You will only need to do this once to work on any of Libra's open source projects.
7
+
For pull request to be accepted by any Diem projects, a CLA must be [signed](https://diem.com/en-US/cla-sign). You will only need to do this once to work on any of Diem's open source projects.
8
8
9
-
When submitting a pull request (PR), the `libra-github-bot` will check your submission for a valid CLA. If one is not found, then you will need to [submit](https://libra.org/en-US/cla-sign) an Individual CLA for yourself or a Corporate CLA for your company.
9
+
When submitting a pull request (PR), the `diem-github-bot` will check your submission for a valid CLA. If one is not found, then you will need to [submit](https://diem.com/en-US/cla-sign) an Individual CLA for yourself or a Corporate CLA for your company.
Copy file name to clipboardexpand all lines: README.md
+23-23
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
> **Note to readers:** On December 1, 2020, the Libra Association was renamed to Diem Association. The project repos are in the process of being migrated. All projects will remain available for use here until the migration to a new GitHub Organization is complete.
2
2
3
-
## Libra Canonical Serialization (LCS)
3
+
## Binary Canonical Serialization (BCS)
4
4
5
-
LCS defines a deterministic means for translating a message or data structure into bytes
5
+
BCS defines a deterministic means for translating a message or data structure into bytes
6
6
irrespective of platform, architecture, or programming language.
7
7
8
8
### Background
9
9
10
-
In Libra, participants pass around messages or data structures that often times need to be
10
+
In Diem, participants pass around messages or data structures that often times need to be
11
11
signed by a prover and verified by one or more verifiers. Serialization in this context refers
12
12
to the process of converting a message into a byte array. Many serialization approaches support
13
13
loose standards such that two implementations can produce two different byte streams that would
@@ -21,12 +21,12 @@ serialized bytes or risk losing the ability to verify messages. This creates a b
21
21
participants to maintain both a copy of the serialized bytes and the deserialized message often
22
22
leading to confusion about safety and correctness. While there exist a handful of existing
23
23
deterministic serialization formats, there is no obvious choice. To address this, we propose
24
-
Libra Canonical Serialization that defines a deterministic means for translating a message into
24
+
Diem Canonical Serialization that defines a deterministic means for translating a message into
25
25
bytes and back again.
26
26
27
27
### Specification
28
28
29
-
LCS supports the following data types:
29
+
BCS supports the following data types:
30
30
31
31
* Booleans
32
32
* Signed 8-bit, 16-bit, 32-bit, 64-bit, and 128-bit integers
@@ -42,20 +42,20 @@ LCS supports the following data types:
42
42
43
43
### General structure
44
44
45
-
LCS is not a self-describing format and as such, in order to deserialize a message, one must
45
+
BCS is not a self-describing format and as such, in order to deserialize a message, one must
46
46
know the message type and layout ahead of time.
47
47
48
48
Unless specified, all numbers are stored in little endian, two's complement format.
49
49
50
-
### Recursion and Depth of LCS Data
50
+
### Recursion and Depth of BCS Data
51
51
52
52
Recursive data-structures (e.g. trees) are allowed. However, because of the possibility of stack
53
-
overflow during (de)serialization, the *container depth* of any valid LCS data cannot exceed the constant
53
+
overflow during (de)serialization, the *container depth* of any valid BCS data cannot exceed the constant
54
54
`MAX_CONTAINER_DEPTH`. Formally, we define *container depth* as the number of structs and enums traversed
55
55
during (de)serialization.
56
56
57
57
This definition aims to minimize the number of operations while ensuring that
58
-
(de)serialization of a known LCS format cannot cause arbitrarily large stack allocations.
58
+
(de)serialization of a known BCS format cannot cause arbitrarily large stack allocations.
59
59
60
60
As an example, if `v1` and `v2` are values of depth `n1` and `n2`,
61
61
* a struct value `Foo { v1, v2 }` has depth `1 + max(n1, n2)`;
@@ -81,7 +81,7 @@ All string and integer values have depths `0`.
81
81
82
82
#### ULEB128-Encoded Integers
83
83
84
-
The LCS format also uses the [ULEB128 encoding](https://en.wikipedia.org/wiki/LEB128) internally
84
+
The BCS format also uses the [ULEB128 encoding](https://en.wikipedia.org/wiki/LEB128) internally
85
85
to represent unsigned 32-bit integers in two cases where small values are usually expected:
86
86
(1) lengths of variable-length sequences and (2) tags of enum values (see the corresponding
87
87
sections below).
@@ -99,15 +99,15 @@ In general, a ULEB128 encoding consists of a little-endian sequence of base-128
99
99
digits. Each digit is completed into a byte by setting the highest bit to 1, except for the
100
100
last (highest-significance) digit whose highest bit is set to 0.
101
101
102
-
In LCS, the result of decoding ULEB128 bytes is required to fit into a 32-bit unsigned
102
+
In BCS, the result of decoding ULEB128 bytes is required to fit into a 32-bit unsigned
103
103
integer and be in canonical form. For instance, the following values are rejected:
104
104
*`[808080808001]` (2^36) is too large.
105
105
*`[8080808010]` (2^33) is too large.
106
106
*`[8000]` is not a minimal encoding of 0.
107
107
108
108
#### Optional Data
109
109
110
-
Optional or nullable data either exists in its full representation or does not. LCS represents
110
+
Optional or nullable data either exists in its full representation or does not. BCS represents
111
111
this as a single byte representing the presence `0x01` or absence `0x00` of data. If the data
112
112
is present then the serialized form of that data follows. For example:
Copy file name to clipboardexpand all lines: README.tpl
+2
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
> **Note to readers:** On December 1, 2020, the Libra Association was renamed to Diem Association. The project repos are in the process of being migrated. All projects will remain available for use here until the migration to a new GitHub Organization is complete.
0 commit comments