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
Copy file name to clipboardExpand all lines: .github/PULL_REQUEST_TEMPLATE.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ The project is undergoing daily changes. Pull Requests will be reviewed and resp
8
8
9
9
(Write your motivation for proposed changes here.)
10
10
11
-
### Have you read the [Contributing Guidelines on pull requests](https://github.com/libra/libra/blob/master/CONTRIBUTING.md#pull-requests)?
11
+
### Have you read the [Contributing Guidelines on pull requests](https://github.com/diem/diem/blob/master/CONTRIBUTING.md#pull-requests)?
12
12
13
13
(Write your answer here.)
14
14
@@ -18,4 +18,4 @@ The project is undergoing daily changes. Pull Requests will be reviewed and resp
18
18
19
19
## Related PRs
20
20
21
-
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/libra/libra/developers.libra.org, and link to your PR here.)
21
+
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/diem/diem/developers.libra.org, and link to your PR here.)
Copy file name to clipboardExpand all lines: client/diem-dev/README.md
+13-13
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,8 @@ Diem has changed a lot since 6/18 and the new whitepaper, but I don't think we'v
8
8
9
9
In the original Diem design, all accounts were the same. Now, every account has exactly one *role*. There are seven roles in all (`ParentVASP`, `ChildVASP`, `DesignatedDealer`, `Validator`, `ValidatorOperator`, `TreasuryCompliance`, and `AssocRoot`), but we will focus on the client-relevant `ParentVASP` and `ChildVASP` roles here. A VASP (virtual asset service provider) is a regulated wallet.
10
10
11
-
* A [ParentVASP](https://github.com/libra/libra/blob/master/language/stdlib/modules/vasp.move#L20;L34) is the unique root account for a particular VASP (i.e., there will be one account of this type per company). A `ParentVASP` carries three key pieces of data: its `human_name`, `base_url` (a URL containing an endpoint to hit for off-chain APIs like exchanging KYC information and the travel rule protocol), and a `compliance_public_key` (ed5519 public key for authenticating signatures on KYC and travel rule payloads).
12
-
* A [ChildVASP](https://github.com/libra/libra/blob/master/language/stdlib/modules/vasp.move#L40) is a child account of a particular parent VASP. A VASP need not have any child accounts, but child accounts allow more sophisticated a VASP to maintain a structured on-chain presence (e.g., separate cold/warm/hot accounts). A parent VASP can currently have an unbounded number of children (though we'll need to pick a reasonable [limit](https://github.com/libra/libra/issues/3949)). A child knows the account address of its parent VASP. When transacting with a child account, clients should use this to look up its parent, then use the `base_url` and `compliance_public_key` of the parent for off-chain communication.
11
+
* A [ParentVASP](https://github.com/diem/diem/blob/master/language/stdlib/modules/vasp.move#L20;L34) is the unique root account for a particular VASP (i.e., there will be one account of this type per company). A `ParentVASP` carries three key pieces of data: its `human_name`, `base_url` (a URL containing an endpoint to hit for off-chain APIs like exchanging KYC information and the travel rule protocol), and a `compliance_public_key` (ed5519 public key for authenticating signatures on KYC and travel rule payloads).
12
+
* A [ChildVASP](https://github.com/diem/diem/blob/master/language/stdlib/modules/vasp.move#L40) is a child account of a particular parent VASP. A VASP need not have any child accounts, but child accounts allow more sophisticated a VASP to maintain a structured on-chain presence (e.g., separate cold/warm/hot accounts). A parent VASP can currently have an unbounded number of children (though we'll need to pick a reasonable [limit](https://github.com/diem/diem/issues/3949)). A child knows the account address of its parent VASP. When transacting with a child account, clients should use this to look up its parent, then use the `base_url` and `compliance_public_key` of the parent for off-chain communication.
13
13
14
14
### Off-Chain Protocols
15
15
@@ -21,14 +21,14 @@ There are two currencies in testnet: `XUS` (stablecoin), and `XDX` (synthetic cu
21
21
22
22
### Addresses, Authentication Keys, and Cryptographic Keys
23
23
24
-
Two major changes in new Diem design are the [shrinking](https://github.com/libra/libra/issues/2764) of account addresses from 32 bytes to 16 bytes and the addition of multisignature authentication keys. A quick primer on how these concepts fit together, since they are very important for clients:
24
+
Two major changes in new Diem design are the [shrinking](https://github.com/diem/diem/issues/2764) of account addresses from 32 bytes to 16 bytes and the addition of multisignature authentication keys. A quick primer on how these concepts fit together, since they are very important for clients:
25
25
26
26
* To create a fresh account address, generate an ed25519 keypair `(K_pub, K_priv)`.
27
27
* Derive a 32 byte authentication key `auth_key = sha3-256(K_pub | 0)`. The `0` is a signature scheme identifier where `0` means single-signature and `1` means multisig.
28
28
* Each account has an `auth_key` that is checked against the public key included in the transaction in order to authenticate the sender.
29
29
* The account address is the last 16 bytes of `auth_key`
30
30
* The first 16 bytes of `auth_key` is the “auth key prefix”. Any transaction that creates an account needs both an account address and an auth key prefix, but a transaction that is sending funds to an existing account needs only the address.
31
-
* Creating a `K`-of-`N`[multisig](https://github.com/libra/libra/blob/master/crypto/crypto/src/multi_ed25519.rs) authentication key is similar: generate `N` ed25519 public keys, then compute `auth_key = (<concatenated_keys> | K | 1)`. Derive an address and an auth key prefix as described above.
31
+
* Creating a `K`-of-`N`[multisig](https://github.com/diem/diem/blob/master/crypto/crypto/src/multi_ed25519.rs) authentication key is similar: generate `N` ed25519 public keys, then compute `auth_key = (<concatenated_keys> | K | 1)`. Derive an address and an auth key prefix as described above.
32
32
* Diem supports key rotation via changing the `auth_key` stored under an account. The address associated with an account never changes.
33
33
34
34
## Exercising New Functionality in Testnet
@@ -37,20 +37,20 @@ Two major changes in new Diem design are the [shrinking](https://github.com/libr
37
37
38
38
As in the original Diem, testnet has a faucet service for creating accounts and giving money to existing accounts. There are three important changes from the original faucet:
39
39
40
-
* The faucet now [needs](https://github.com/libra/libra/pull/3972) one of the currency codes above
41
-
* The faucet can accept either a 16 byte address (for an existing account), a 32 byte account authentication key (for an account that does not yet exist and should be created by the faucet). Previously, account addresses and authentication keys were both 32 byte values, but account addresses have [shrunk](https://github.com/libra/libra/issues/2764).
40
+
* The faucet now [needs](https://github.com/diem/diem/pull/3972) one of the currency codes above
41
+
* The faucet can accept either a 16 byte address (for an existing account), a 32 byte account authentication key (for an account that does not yet exist and should be created by the faucet). Previously, account addresses and authentication keys were both 32 byte values, but account addresses have [shrunk](https://github.com/diem/diem/issues/2764).
42
42
* An account created by the faucet has the `ParentVASP` role. Note that in mainnet, only the Association will have the privilege to create `ParentVASP`s, and will do so only for entities that meet appropriate standards.
43
43
44
44
### Transactions
45
45
46
46
Transactions are mostly unchanged from the original design. Two notable differences are:
47
47
48
-
* Transactions now require a [`gas_currency_code`](https://github.com/libra/libra/blob/master/types/src/transaction/mod.rs#L72) specifying which currency should be used to pay for gas. The account must have a balance in this currency.
49
-
* The signature scheme for a transaction can be either be single-signature ed25519 (as the original design) or multi-ed25519, a new [multisig](https://github.com/libra/libra/issues/2431) format
48
+
* Transactions now require a [`gas_currency_code`](https://github.com/diem/diem/blob/master/types/src/transaction/mod.rs#L72) specifying which currency should be used to pay for gas. The account must have a balance in this currency.
49
+
* The signature scheme for a transaction can be either be single-signature ed25519 (as the original design) or multi-ed25519, a new [multisig](https://github.com/diem/diem/issues/2431) format
50
50
51
51
### Payments
52
52
53
-
Payments can be sent using [this](https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/peer_to_peer_with_metadata.move) transaction script. There are a few changes:
53
+
Payments can be sent using [this](https://github.com/diem/diem/blob/master/language/stdlib/transaction_scripts/peer_to_peer_with_metadata.move) transaction script. There are a few changes:
54
54
55
55
* The script requires a generic type parameter `Token` specifying the currency to be transferred. The sending and receiving account must both have a balance in this currency. A transaction that attempts to send (e.g.) `XDX` to an account that doesn’t have an `XDX` balance will abort.
56
56
* The script has a `metadata` parameter that accepts arbitrary binary data. For most transactions, the metadata should be the subaddress of the VASP customer receiving the payment. The contents of `metadata` are emitted in payment events, but are not otherwise inspected on-chain (so using empty or dummy `metadata` is just fine for testing).
@@ -59,11 +59,11 @@ Payments can be sent using [this](https://github.com/libra/libra/blob/master/lan
59
59
60
60
### Creating Child VASP Accounts
61
61
62
-
As mentioned above, any account created by the faucet has the `ParentVASP` role. You can create a child VASP account from a parent VASP using the [`create_child_vasp_account`](https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/create_child_vasp_account.move) transaction script. Attempting to create a child VASP account from another child VASP will abort.
62
+
As mentioned above, any account created by the faucet has the `ParentVASP` role. You can create a child VASP account from a parent VASP using the [`create_child_vasp_account`](https://github.com/diem/diem/blob/master/language/stdlib/transaction_scripts/create_child_vasp_account.move) transaction script. Attempting to create a child VASP account from another child VASP will abort.
63
63
64
64
### Adding Currencies to Accounts
65
65
66
-
Each newly created account accepts at least one currency, which as specified as a currency code type parameter to the account creation script. New currencies can be added to an existing account via the `add_currency_to_account`[script](https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/add_currency_to_account.move). In addition, a child VASP account can be prepopulated with all currencies in the system by using the `add_all_currencies` flag in the script above.
66
+
Each newly created account accepts at least one currency, which as specified as a currency code type parameter to the account creation script. New currencies can be added to an existing account via the `add_currency_to_account`[script](https://github.com/diem/diem/blob/master/language/stdlib/transaction_scripts/add_currency_to_account.move). In addition, a child VASP account can be prepopulated with all currencies in the system by using the `add_all_currencies` flag in the script above.
67
67
68
68
### Dual Attestation/Travel Rule Protocol
69
69
@@ -75,7 +75,7 @@ In Diem mainnet every payment transaction between two **distinct **VASP accounts
75
75
76
76
Details of doing this exchange in production will be published soon, but we will explain how to mock the protocol locally for testing purposes.
77
77
78
-
Every parent VASP created by the faucet has a dummy `base_url` and `compliance_public_key`. However, you can use [these](https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/rotate_base_url.move)[scripts](https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/rotate_compliance_public_key.move) to send a transaction from the parent VASP that sets the URL/key to meaningful values. Once this is done, you can construct the message to be signed and craft a dual attestation transaction with the following ingredients:
78
+
Every parent VASP created by the faucet has a dummy `base_url` and `compliance_public_key`. However, you can use [these](https://github.com/diem/diem/blob/master/language/stdlib/transaction_scripts/rotate_base_url.move)[scripts](https://github.com/diem/diem/blob/master/language/stdlib/transaction_scripts/rotate_compliance_public_key.move) to send a transaction from the parent VASP that sets the URL/key to meaningful values. Once this is done, you can construct the message to be signed and craft a dual attestation transaction with the following ingredients:
79
79
80
80
*`payer_vasp_address`: the address of the payer (can be either a parent or child VASP)
81
81
*`payee_vasp_address`: the address of the payee (can be either a parent or child VASP). Encoding: LCS `[u8; 16]`
@@ -84,4 +84,4 @@ Every parent VASP created by the faucet has a dummy `base_url` and `compliance_
84
84
85
85
The payee VASP should sign the [LCS](https://developers.diem.com/docs/rustdocs/diem_canonical_serialization/index.html)-encoded (see types above) message `reference_id | payer_vasp_address | amount | @@$$DIEM_ATTEST$$@@`. to produce a `payee_signature`. The `@@$$DIEM_ATTEST$$@@` part is a domain separator intended to prevent misusing a different signature from the same key (e.g., interpreting a KYC signature as a travel rule signature).
86
86
87
-
Finally, send a transaction from payer_vasp_address using the payment [script](https://github.com/libra/libra/blob/master/language/stdlib/transaction_scripts/peer_to_peer_with_metadata.move) mentioned above with `payee = payee_vasp_address, amount = amount, metadata = reference_id, metadata_signature = payee_signature`.
87
+
Finally, send a transaction from payer_vasp_address using the payment [script](https://github.com/diem/diem/blob/master/language/stdlib/transaction_scripts/peer_to_peer_with_metadata.move) mentioned above with `payee = payee_vasp_address, amount = amount, metadata = reference_id, metadata_signature = payee_signature`.
Copy file name to clipboardExpand all lines: client/swiss-knife/README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ The `sample_inputs` folder contains a list of sample json inputs for various ope
16
16
## Examples for generate-raw-txn and generate-signed-txn operations
17
17
18
18
```
19
-
# Generate a peer_to_peer_transafer raw transaction (https://github.com/libra/libra/blob/1f86705b/language/transaction-builder/src/generated.rs#L447)
19
+
# Generate a peer_to_peer_transafer raw transaction (https://github.com/diem/diem/blob/1f86705b/language/transaction-builder/src/generated.rs#L447)
20
20
# For the txn_params json schema, look at the `struct TxnParams`
21
21
# For the script_params json schema, look at the `struct MoveScriptParams`
22
22
# Note about chain_id: For chain_id parameter, refer to the `enum NamedChain` in `chain_id.rs`. Also, please note that the numeric representation of the chain id ("0", "1", "2", etc.) can also be passed to the chain_id
# Generate a preburn raw transaction (https://github.com/libra/libra/blob/1f86705b/language/transaction-builder/src/generated.rs#L480)
45
+
# Generate a preburn raw transaction (https://github.com/diem/diem/blob/1f86705b/language/transaction-builder/src/generated.rs#L480)
46
46
$ cargo run -p swiss-knife -- generate-raw-txn < sample_inputs/generate_raw_txn_preburn.json
0 commit comments