Skip to content
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

feat(runtime): Add delegate keys #342

Closed
wants to merge 2 commits into from
Closed

Conversation

ilblackdragon
Copy link
Member

@ilblackdragon ilblackdragon commented Mar 27, 2022

Summary

Delegate keys allow to assign permissions to another account instead of a key.
This allows to delegate ownership of an account by giving set of permissions that are usually restricted only to FullAccessKey.

Motivation

Issue that became evident trying to develop upgradability patterns for contracts is complexity of going from full access key on the contract to a contract managed by multisig or a DAO.

Right now it is required to implement a complex logic of upgrading contract and managing assets/control inside the contract in the first version to allow “owner” account to call these methods.

Rationale and alternatives

Specification

See updates to AccessKey.md and Actions.md

Reference Implementation

TBD

Drawbacks

This adds complexity to the account model.

Copyright

Copyright and related rights waived via CC0.

@render
Copy link

render bot commented Mar 27, 2022

@ilblackdragon ilblackdragon changed the title Add delegate keys feat(runtime): Add delegate keys Mar 27, 2022
Copy link
Contributor

@10d9e 10d9e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ilblackdragon content looks great, mostly cosmetic and structural change requests here.

@@ -0,0 +1,41 @@
---
NEP: 297
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to NEP: 342

Author: Illia Polosukhin <illia@near.org>
DiscussionsTo: https://gov.near.org/t/proposal-extending-nears-account-with-aliases-and-delegated-keys/9450
Status: Draft
Type:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to Type: Standards Track


## DelegateAction

Delegate action allows to execute an action on antoher account.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*another


See updates to AccessKey.md and Actions.md

## Reference Implementation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated this to be an optional section for non-Contract categories of standards like this one. Please feel free to omit.


## Specification

See updates to AccessKey.md and Actions.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are looking to have these NEP spec artifacts as stand-alone as possible. It feels superfluous, but could you please copy the content of AccessKey.md and Actions.md into this section. In future new specs I am going to recommend only creating the docusaurus sections during the Last Call phase.

@@ -48,6 +49,35 @@ pub struct FunctionCallPermission {
}
```

## AccountKeyPermission::DelegateCall

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the following warning section:

:::caution
This is part of proposed spec [NEP-342](https://github.com/near/NEPs/blob/master/neps/nep-0342.md) and subject to change.
:::

@@ -276,3 +277,29 @@ DeleteAccountStaking { account_id: AccountId }

**Execution Error**:
- If state or storage is corrupted, a `StorageError` is returned.

## DelegateAction

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the following warning section:

:::caution
This is part of proposed spec [NEP-342](https://github.com/near/NEPs/blob/master/neps/nep-0342.md) and subject to change.
:::

@frol frol added T-runtime About NEAR Protocol Runtime (actions, Wasm, fees accounting) WG-protocol Protocol Standards Work Group should be accountable labels Sep 5, 2022
@bowenwang1996 bowenwang1996 added the S-draft/needs-moderator-review A NEP in the DRAFT stage that needs a moderator review. label Sep 28, 2022
@ori-near ori-near added the A-NEP A NEAR Enhancement Proposal (NEP). label Oct 13, 2022
@ori-near ori-near added S-draft/needs-author-revision A NEP in the DRAFT stage that needs an author revision. and removed S-draft/needs-moderator-review A NEP in the DRAFT stage that needs a moderator review. labels Feb 14, 2023
@ori-near
Copy link
Contributor

Hi @ilblackdragon (or anyone who is interested in championing this NEP forward), we are cleaning the NEP backlog and noticed that this PR is still in "Draft" mode. Therefore, we are re-labeling this PR as "Needs author revision."

Please ping the @near/nep-moderators once you are ready for us to review it. We will review it again in April, unless we hear from you sooner. We typically close NEPs that are inactive for more than two months, so please let us know if you need more time.

@DavidM-D
Copy link
Contributor

@itegulov might be

@walnut-the-cat
Copy link
Contributor

Hello! Protocol NEP moderator here. Another ping on the matter as it seems there hasn't been any activity on this NEP for quite some time. Is it still on going? Or shall we close NEP for now?

@ilblackdragon
Copy link
Member Author

This is outdated now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-NEP A NEAR Enhancement Proposal (NEP). S-draft/needs-author-revision A NEP in the DRAFT stage that needs an author revision. T-runtime About NEAR Protocol Runtime (actions, Wasm, fees accounting) WG-protocol Protocol Standards Work Group should be accountable
Projects
Status: RETRACTED
Development

Successfully merging this pull request may close these issues.

7 participants