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: generalized_accounts/README.md
+26-21Lines changed: 26 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,14 @@
3
3
4
4
## Motivation
5
5
6
-
Plain old accounts (POA) have very little flexibility when it comes to the logic
7
-
controlling them. While this results in a uniform user experience and makes
8
-
development easier, e.g. a wallet only needs to handle a single method of
6
+
Plain old accounts (POA) have very little flexibility when it comes to the
7
+
logic controlling them. While this results in a uniform user experience and
8
+
makes development easier, e.g. a wallet only needs to handle a single method of
9
9
accessing accounts, it also ignores that people may have varying needs when
10
10
managing their accounts.
11
11
12
12
This has led to a variety of smart contract wallets being developed, which can
13
-
enforce spending limits, enable more sophisticated authorisation schemes via
13
+
enforce spending limits, enable more sophisticated authorization schemes via
14
14
multi-signatures and other things. The biggest drawback of this approach is the
15
15
need to still own a "normal" account, in order to invoke the smart contract and
16
16
pay for its execution.
@@ -25,7 +25,7 @@ system.
25
25
## Approaches
26
26
27
27
We give a brief overview of some of the different approaches, that would allow
28
-
for authorisation logic to be more flexible.
28
+
for authorization logic to be more flexible.
29
29
30
30
They lie on a spectrum from the current fixed signature and nonce scheme to
31
31
having full fledged smart contracts.
@@ -41,22 +41,22 @@ do it:
41
41
In either case, signature logic will need to be touched, s.t. an empty signature
42
42
can be accepted.
43
43
44
-
Additionally, the more flexible authorisation logic will make transaction
44
+
Additionally, the more flexible authorization logic will make transaction
45
45
validation costlier and therefore also increase the associated fees.
46
46
47
47
48
48
### Side-effect free
49
49
50
50
A fairly non-invasive solution would be to attach a pure function to accounts.
51
-
This means that all relevant authorisation code and data, e.g. public keys for
51
+
This means that all relevant authorization code and data, e.g. public keys for
52
52
signature checks, have to be included directly in the function body and can not
53
53
be updated. Nonce handling would still be handled implicitly, i.e. stay
54
54
unchanged.
55
55
56
-
Making the authorisation function optional ensures POAs to not be impacted.
56
+
Making the authorization function optional ensures POAs to not be impacted.
57
57
58
58
The downsides of this would be the need to for special handling of the
59
-
authorisation code because execution would not happen in the normal VM context
59
+
authorization code because execution would not happen in the normal VM context
60
60
and thus likely end up with a lot of implementation complexity.
61
61
62
62
This approach would be a slight improvement over the status quo but still leave
@@ -80,11 +80,11 @@ transaction types.
80
80
### Hybrid
81
81
82
82
For the hybrid solution POAs and smart contracts stay separate, meaning that
83
-
accounts can still be used with the implicit nonce and signature authorisation.
83
+
accounts can still be used with the implicit nonce and signature authorization.
84
84
But accounts are extended with two new fields, allowing its owner to specify the
85
85
address of a smart contract and name of a function, which will be called
86
86
whenever a transaction needs to be authorised.
87
-
As soon as the new authorisation contract is attached to an account, it is no
87
+
As soon as the new authorization contract is attached to an account, it is no
88
88
longer possible to author transactions with the old nonce plus signature method.
89
89
90
90
@@ -122,11 +122,11 @@ prevents replay of old transactions.
122
122
123
123
In addition to integrity, the signature is used to prove that the issuer knows
124
124
the private key for the public key specified in the `from` field, i.e. used as
125
-
authorisation.
125
+
authorization.
126
126
127
127
The above scheme is the only one natively supported via the POA.
128
128
129
-
If the authorisation were to be abstracted as well, then we end up with:
129
+
If the authorization were to be abstracted as well, then we end up with:
130
130
131
131
```
132
132
Fieldname Size (bytes)
@@ -188,18 +188,18 @@ to
188
188
-------------- -----
189
189
```
190
190
191
-
For the actual wire format please consult the [serialisation](../serializations.md) document.
191
+
For the actual wire format please consult the [serialization](../serializations.md) document.
192
192
193
193
The `ga_contract` MUST be the identifier of a deployed contract or empty.
194
194
The `ga_auth_fun` MUST be the identifier of a function to be called or empty.
195
195
196
196
If the `ga_contract` field is not empty, then the `ga_auth_fun` field MUST NOT
197
197
be empty.
198
198
199
-
If `ga_contract` is not empty, then authorisation MUST be done by calling the
199
+
If `ga_contract` is not empty, then authorization MUST be done by calling the
200
200
`ga_auth_fun` of the contract located at `ga_contract`. The data provided to the
201
201
`ga_auth_fun` is supplied via a [`meta_tx`](#meta_tx). The `ga_auth_fun` MUST
202
-
return `true` for the authorisation to succeed.
202
+
return `true` for the authorization to succeed.
203
203
204
204
The `nonce` field is irrelevant if the account is a GA.
205
205
@@ -209,7 +209,7 @@ i.e. after a POA has been converted to a GA it cannot be undone.
209
209
The `ga_contract` and `ga_auth_fun` fields MUST NOT change after they have been
210
210
set once.
211
211
212
-
If the `ga_contract` field is empty, then authorisation MUST be done via the old
212
+
If the `ga_contract` field is empty, then authorization MUST be done via the old
213
213
verification of the signature attached to transactions. In this case, a
214
214
transaction MUST only be considered valid, if
215
215
1. a signature is attached, that has been produced by the private key that
@@ -252,7 +252,7 @@ Afterwards the new `meta_tx` is used to interact with the GA.
252
252
-------------- -----
253
253
```
254
254
255
-
For the actual wire format please consult the [serialisation](../serializations.md) document.
255
+
For the actual wire format please consult the [serialization](../serializations.md) document.
256
256
257
257
The semantics of this transaction are almost identical to the [Create Contract Transaction](../contracts/contract_transactions.md#create-contract-transaction).
258
258
As such, only the additional logic not covered by the `Create Contract
@@ -268,7 +268,7 @@ considered invalid.
268
268
The transaction MUST include a signature created by the private key belonging to
269
269
the `owner_id`.
270
270
271
-
The `auth_fun` is a function hash as described in the
271
+
The `auth_fun` is a function hash as described in the
0 commit comments