-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
ERC-1207 DAuth Access Delegation Standard #1207
Comments
I guess you don't have to change to title per PR. But it's fine. Good idea. DAuth is a long waited standard~
|
@xinbenlv
|
Have you looked at https://eips.ethereum.org/EIPS/eip-927? |
@Arachnid In eip-927, a metadata registry contract is needed for the verification process. In eip-1207 we take a different approach by coupling functional interface with DAuth interface, as seen in EIP20DAuth. We are totally open for discussion and looking forward to hear feedbacks from the community. |
There has been no activity on this issue for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review. |
This issue was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment. |
DAuth Access Delegation Standard
Simple Summary
DAuth is a standard interface for accessing authorization delegation between smart contracts and users.
Abstract
The DAuth protocol defines a set of standard API allowing identity delegations between smart contracts without the user's private key. Identity delegations include accessing and operating a user's data and assets contained in the delegated contracts.
Motivation
The inspiration for designing DAuth comes from OAuth protocol that is extensively used in web applications. But unlike the centralized authorization of OAuth, DAuth works in a distributed manner, thus providing much more reliability and generality.
Specification
Resource owner: the authorizer
Resource contract: the contract providing data and operators
API: the resource contract APIs that the grantee contract can invoke
Client contract: the grantee contract using authorization to access and operate the data
Grantee request: the client contract calls the resource contract with the authorizer authorization
AuthInfo
Required - The struct contains user authorization information
funcNames
: a list of function names callable by the granted contractexpireAt
: the authorization expire timestamp in secondsuserAuth
Required - userAuth maps (authorizer address, grantee contract address) pair to the user’s authorization AuthInfo object
callableFuncNames
Required - All methods that are allowed other contracts to call
updateCallableFuncNames
Optional - Update the callable function list for the client contract by the resource contract's administrator
_invokes
: the invoke methods that the client contract can callverify
Required - check the invoke method authority for the client contract
_authorizer
: the user address that the client contract agents_invoke
: the invoke method that the client contract wants to callgrant
Required - delegate a client contract to access the user's resource
_grantee
: the client contract address_invokes
: the callable methods that the client contract can access. It is a string which contains all function names split by spaces_expireAt
: the authorization expire timestamp in secondsregrant
Optional - alter a client contract's delegation
revoke
Required - delete a client contract's delegation
_grantee
: the client contract addressGrant
grant
orregrant
processes successfullyRevoke
Callable Resource Contract Functions
All public or external functions that are allowed the grantee to call MUST use overload to implement two functions: The First one is the standard method that the user invokes directly, the second one is the grantee methods of the same function name with one more authorizer address parameter.
Example:
Rationale
Current Limitations
The current design of many smart contracts only considers the user invokes the smart contract functions by themselves using the private key. However, in some case, the user wants to delegate other client smart contracts to access and operate their data or assets in the resource smart contract. There isn’t a common protocol to provide a standard delegation approach.
Rationale
On the Ethereum platform, all storage is transparent and the
msg.sender
is reliable. Therefore, the DAuth don't need anaccess_token
like OAuth. DAuth just recodes the users' authorization for the specific client smart contract's address. It is simple and reliable on the Ethereum platform.Backwards Compatibility
This EIP introduces no backward compatibility issues.
Implementation
Following is the DAuth Interface implementation. Furthermore, the example implementations of EIP20 Interface and ERC-DAuth Interface are also provided. Developers can easily implement their own contracts with ERC-DAuth Interface and other EIP.
ERC-DAuth Interface implementation is available at:
https://github.com/DIA-Network/ERC-DAuth/blob/master/ERC-DAuth-Interface.sol
Example implementation with EIP20 Interface and ERC-DAuth Interface is available at:
https://github.com/DIA-Network/ERC-DAuth/blob/master/eip20-dauth-example/EIP20DAuth.sol
Copyright
Copyright and related rights waived via CC0.
The text was updated successfully, but these errors were encountered: