Skip to content

Comments

Add EIP-6617: Add a new bit based permission proposal#6617

Merged
eth-bot merged 15 commits intoethereum:masterfrom
orochi-network:feature/bit_based_permission
Mar 9, 2023
Merged

Add EIP-6617: Add a new bit based permission proposal#6617
eth-bot merged 15 commits intoethereum:masterfrom
orochi-network:feature/bit_based_permission

Conversation

@chiro-hiro
Copy link
Contributor

No description provided.

Co-authored-by: Chiro Hiro <chiro8x@gmail.com>
Co-authored-by: Victor Dusart <43795504+vdusart@users.noreply.github.com>
@chiro-hiro chiro-hiro requested a review from eth-bot as a code owner March 6, 2023 04:11
@github-actions github-actions bot added s-draft This EIP is a Draft t-erc labels Mar 6, 2023
@eth-bot
Copy link
Collaborator

eth-bot commented Mar 6, 2023

All reviewers have approved. Auto merging...

@eth-bot eth-bot added e-consensus Waiting on editor consensus e-review Waiting on editor to review labels Mar 6, 2023
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Mar 6, 2023
@chiro-hiro
Copy link
Contributor Author

Hi @Pandapip1,

We add a new Bit Based Permission proposal as your request. I and @vdusart will update EIP-6366 as well.

@chiro-hiro chiro-hiro mentioned this pull request Mar 6, 2023
@abcoathup
Copy link
Contributor

The PR doesn't have a c-new label?


The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.

_Note_ The following specifications use syntax from Solidity `0.8.7` (or above)
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't include any solidity. I think you forgot to include the interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vdusart implemented a library to perform bit wise operators

With the `256` bits of the `uint256`, we can create up to `256` differents permissions which leads to `2²⁵⁶` unique combinaisons also called roles.
*(A role is a combination of multiple permissions).* All roles don't have to be predefined.

Since permissions are defined as powers of two, we can use the `OR` operator to create new role based on multiple permissions.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Since permissions are defined as powers of two, we can use the `OR` operator to create new role based on multiple permissions.
Since permissions are defined as unsigned integers, we can use the binary OR operator to create new role based on multiple permissions.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

## Motivation

Currently permission and access control are done using `string` or `keccak256(string)` comparaisons (see [ERC-5982](./eip-5982.md)).
By using bitwise and bitmask operations to determine access rights, we gain in efficiency, flexibility and more.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
By using bitwise and bitmask operations to determine access rights, we gain in efficiency, flexibility and more.

This reads like Rationale.

vdusart and others added 2 commits March 6, 2023 15:15
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
@github-actions github-actions bot added c-new Creates a brand new proposal and removed w-ci Waiting on CI to pass labels Mar 6, 2023
vdusart and others added 4 commits March 6, 2023 15:16
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Mar 6, 2023
@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Mar 7, 2023
@Pandapip1 Pandapip1 changed the title Add a new bit based permission proposal Add EIP-6617: Add a new bit based permission proposal Mar 8, 2023
vdusart and others added 5 commits March 9, 2023 01:13
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
@github-actions
Copy link

github-actions bot commented Mar 9, 2023

The commit 775c356 (as a parent of 2eb7729) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot added the w-ci Waiting on CI to pass label Mar 9, 2023
@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Mar 9, 2023
EIPS/eip-6617.md Outdated
/**
@notice Add permission
@param _permission The given permission
@param _permissionToAdd The permission that will be added
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vdusart I think, code formatter is broken.

Copy link
Member

@Pandapip1 Pandapip1 left a comment

Choose a reason for hiding this comment

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

Lgtm for draft

@eth-bot eth-bot enabled auto-merge (squash) March 9, 2023 13:39
@eth-bot eth-bot merged commit 511b961 into ethereum:master Mar 9, 2023
@chiro-hiro chiro-hiro deleted the feature/bit_based_permission branch March 10, 2023 05:34
fulldecent pushed a commit to fulldecent/EIPs that referenced this pull request Mar 13, 2023
* Add a new bit based permission proposal

Co-authored-by: Chiro Hiro <chiro8x@gmail.com>
Co-authored-by: Victor Dusart <43795504+vdusart@users.noreply.github.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Add suggestions (ethereum#9)

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* fix typos and CI/CD

* formatting

---------

Co-authored-by: Victor Dusart <43795504+vdusart@users.noreply.github.com>
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
Co-authored-by: Victor DUSART <dusartvictor@gmail.com>
axelcabee pushed a commit to axelcabee/EIPs that referenced this pull request May 6, 2023
* Add a new bit based permission proposal

Co-authored-by: Chiro Hiro <chiro8x@gmail.com>
Co-authored-by: Victor Dusart <43795504+vdusart@users.noreply.github.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Add suggestions (ethereum#9)

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* fix typos and CI/CD

* formatting

---------

Co-authored-by: Victor Dusart <43795504+vdusart@users.noreply.github.com>
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
Co-authored-by: Victor DUSART <dusartvictor@gmail.com>
GAEAlimited pushed a commit to GAEAlimited/EIPs that referenced this pull request Jun 19, 2024
* Add a new bit based permission proposal

Co-authored-by: Chiro Hiro <chiro8x@gmail.com>
Co-authored-by: Victor Dusart <43795504+vdusart@users.noreply.github.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-bit_based_permission.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Add suggestions (#9)

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* Update EIPS/eip-6617.md

Co-authored-by: Gavin John <gavinnjohn@gmail.com>

* fix typos and CI/CD

* formatting

---------

Co-authored-by: Victor Dusart <43795504+vdusart@users.noreply.github.com>
Co-authored-by: Gavin John <gavinnjohn@gmail.com>
Co-authored-by: Victor DUSART <dusartvictor@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c-new Creates a brand new proposal e-consensus Waiting on editor consensus e-review Waiting on editor to review s-draft This EIP is a Draft t-erc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants