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
## Motivation
Currently client processes own a private key (`AccountSecretKey`) which
is potentially insecure but also prevents implementation of external
signers (wallet extensions, hardware wallets, etc.). This PR addresses
that.
## Proposal
We achieve that by the introduction of a new `Signer` trait that
encapsulates the actions of signing and getting a public key for an
`AccountOwner` instance. A couple of other changes were made/introduced
to support that:
- `Signer` is passed around as `Box<dyn Signer>` to hide the
implementation details of the actual `Signer` instance.
- `Signer::sign` signs a `CryptoHash` (rather than `T: BcsSignable`).
- (required by the above ☝️ ) New `sign_prehash(self, CryptoHash)`
methods added on all secret keys types in the `linera-crypto`
- An `InMemSigner` was introduced for backwards-compatibility and
intermediate usage in native and web clients.
- Removed `assigned_keys` and `unassignd_keys` from the `Wallet`. Now
the `Signer` is the source of truth about which keys are available.
## Test Plan
All tests have been updated to pass.
## Release Plan
- Nothing to do / These changes follow the usual release cycle.
## Links
<!--
Optional section for related PRs, related issues, and other references.
If needed, please create issues to track future improvements and link
them here.
-->
- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
@@ -71,6 +72,7 @@ A Byzantine-fault tolerant sidechain with low-latency finality and high throughp
71
72
*`open-chain` — Open (i.e. activate) a new chain deriving the UID from an existing one
72
73
*`open-multi-owner-chain` — Open (i.e. activate) a new multi-owner chain deriving the UID from an existing one
73
74
*`change-ownership` — Change who owns the chain, and how the owners work together proposing blocks
75
+
*`set-preferred-owner` — Change the preferred owner of a chain
74
76
*`change-application-permissions` — Changes the application permissions configuration
75
77
*`close-chain` — Close an existing chain
76
78
*`local-balance` — Read the current native-token balance of the given account directly from the local state
@@ -95,7 +97,7 @@ A Byzantine-fault tolerant sidechain with low-latency finality and high throughp
95
97
*`create-application` — Create an application
96
98
*`publish-and-create` — Create an application, and publish the required module
97
99
*`keygen` — Create an unassigned key pair
98
-
*`assign` — Link an owner with a key pair in the wallet to a chain that was created for that owner
100
+
*`assign` — Link the owner to the chain. Expects that the caller has a private key corresponding to the `public_key`, otherwise block proposals will fail when signing with it
99
101
*`retry-pending-block` — Retry a block we unsuccessfully tried to propose earlier
100
102
*`wallet` — Show the contents of the wallet
101
103
*`project` — Manage Linera projects
@@ -106,6 +108,7 @@ A Byzantine-fault tolerant sidechain with low-latency finality and high throughp
106
108
107
109
*`--storage <STORAGE_CONFIG>` — Storage configuration for the blockchain history
108
110
*`--wallet <WALLET_STATE_PATH>` — Sets the file storing the private state of user chains (an empty one will be created if missing)
111
+
*`--keystore <KEYSTORE_PATH>` — Sets the file storing the keystore state
109
112
*`-w`, `--with-wallet <WITH_WALLET>` — Given an ASCII alphanumeric parameter `X`, read the wallet state and the wallet storage config from the environment variables `LINERA_WALLET_{X}` and `LINERA_STORAGE_{X}` instead of `LINERA_WALLET` and `LINERA_STORAGE`
110
113
*`--send-timeout-ms <SEND_TIMEOUT>` — Timeout for sending queries (milliseconds)
111
114
@@ -267,6 +270,19 @@ Specify the complete set of new owners, by public key. Existing owners that are
*`--chain-id <CHAIN_ID>` — The ID of the chain whose preferred owner will be changed
282
+
*`--owner <OWNER>` — The new preferred owner
283
+
284
+
285
+
270
286
## `linera change-application-permissions`
271
287
272
288
Changes the application permissions configuration
@@ -718,7 +734,7 @@ Create an unassigned key pair
718
734
719
735
## `linera assign`
720
736
721
-
Link an owner with a key pair in the wallet to a chain that was created for that owner
737
+
Link the owner to the chain. Expects that the caller has a private key corresponding to the `public_key`, otherwise block proposals will fail when signing with it
0 commit comments