-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KIP-0014: Updated KIP-0012 Account Protocols #22
Open
sirlensalot
wants to merge
1
commit into
master
Choose a base branch
from
kip-0014
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
--- | ||
KIP: "0014" | ||
Title: Updated KIP-0012 Account Protocols | ||
Author: Stuart Popejoy [email protected], Doug Beardsley [email protected] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Author |
||
Status: Draft | ||
Type: Standard | ||
Category: Chainweb | ||
Created: 2021-12-22 | ||
--- | ||
|
||
## Abstract | ||
|
||
Augment KIP-0012 account protocols with two new protocols, Guard Accounts and Rotatable Accounts. | ||
Modify KIP-0012 Single-Key Accounts to forbid rotation. | ||
|
||
## Motivation | ||
|
||
KIP-0012 introduced Account Protocols and the Single-Account protocol, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kip_0012 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kip_0012 |
||
as implemented in the KDA `coin` contract and elsewhere. | ||
KIP-0012 reserves all account names starting with `C:` where `C` is a single alpha protocol identifier. | ||
|
||
The KIP-0012 Single-Account protocol specifies `k:KEY` where KEY is a hex lowercase ED25519 public key. | ||
This functions to _reserve the account name_ on any chain which avoids problems like | ||
"squatting" where an account for a given name on one chain is grabbed by a malicious actor on | ||
another chain. `k:` has effectively neutralized this threat vector. | ||
|
||
However, `k:` is deficient in the following ways: | ||
|
||
### Rotation considered harmful for "k:" accounts | ||
|
||
Under `fungible-v2` and other standards, `rotate` is specified where an account guard can be | ||
changed. This presents a challenge to many systems that are accustomed to single-key standards | ||
on other blockchains such as Bitcoin and Ethereum where an "address" is irrevocably tied | ||
to a single key. As such this presents problems for "total chain analysis" of a given token | ||
using standard methods like tracking `fungible-v2.TRANSFER` events, which only provide account | ||
names and not guards. | ||
|
||
While rotation has proven useful with `k:` accounts, this is largely because `k:` makes _account | ||
reservation_ possible, but by allowing rotate, this robs the protocol from a significant benefit | ||
which is simplified and robust chain accounting. | ||
|
||
### Rotatable Accounts | ||
|
||
The solution proposed here is to (1) forbid rotation in `k:` accounts and (2) provide a "Rotatable | ||
Account" protocol explicitly for rotation. This allows token protocols that wish to forbid rotation to | ||
simply not support the Rotatable protocol. | ||
|
||
Rotatable Accounts specify `r:GUARD_HASH` where GUARD_HASH is the BLAKE2b256 hash of the canonical JSON encoding of | ||
the pact guard. At creation time the account is validated to have the hash of the provided guard. | ||
Rotatable Accounts unsurprisingly put no restrictions on rotation. | ||
|
||
### Guard Accounts: non-rotatable reservation for any guard type | ||
|
||
Reservation is obviously an essential feature, and currently `k:` accounts are used for this | ||
and then rotated to other guards. We observer that autonomous use cases like module guards lack | ||
_any_ method for reservation currently as they cannot produce a key-based witness. | ||
|
||
We propose "Guard Accounts" to add non-rotatable support for other guard types. Guard Accounts | ||
specify `g:GUARD_HASH` where GUARD_HASH is the BLAKE2b256 hash of the canonical JSON encoding of | ||
the pact guard. At creation time the account is validated to have the hash of the provided guard. | ||
Guard accounts are NOT rotatable. | ||
|
||
## Rationale | ||
|
||
Expanding reservation capability to all custody types is an obvious win, so Guard Accounts needs | ||
no further justification there. | ||
|
||
Restricting rotation is strongly opinionated, obviously. However we argue that non-rotatable `k:` | ||
and `g:` accounts follows a "principle of least surprise", given that single-key, non-rotatable custody | ||
is overwhelmingly the norm, leading to potentially dangerous confusion for users. | ||
|
||
The other big win of non-rotation is the dramatic simplification of total chain accounting and custody | ||
analysis. Indeed certain tokens that have higher tracking requirements for AML concerns etc can | ||
simply not support vanity and Rotatable accounts altogether, allowing them to confidently use the | ||
`fungible-v2.TRANSFER` event stream to populate any downstream datastores. | ||
|
||
Rotation uses the guard hash in order to support autonomous use cases (since single-key can obviously | ||
be supported in Guard and Rotatable accounts, as it is "just another guard"). | ||
|
||
|
||
## Backwards Compatibility | ||
|
||
Since KIP-0012 already reserved all `C:` account names, there are no conflicts with the new protocols. | ||
Again since this only impacts account creation, there are no backcompat issues for existing accounts. | ||
|
||
Forbidding rotation from `k:` accounts means that users employing `k:` accounts for this use case should | ||
seek to migrate to other accounts such as "vanity" (non-protocol) and Rotatable accounts. | ||
|
||
## Specification | ||
|
||
Guard accounts are identified by `g:GUARD_HASH` where GUARD_HASH is the BLAKE2b256 hash of | ||
the canonical JSON encoding of | ||
the account guard. Rotation is forbidden. | ||
|
||
Rotatable accounts are identified by `r:GUARD_HASH` where GUARD_HASH is the BLAKE2b256 hash of | ||
the canonical JSON encoding of | ||
the account guard at creation time. Rotation is permitted. | ||
|
||
Rotation will be forbidden for `k:` accounts, except in the case where the account is being rotated | ||
back to the original key for those accounts that had been previously rotated. | ||
|
||
Implementation in Pact is TBD for this KIP. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay