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

Transaction Capability Authorization #63

Open
heikoheiko opened this issue May 2, 2016 · 0 comments
Open

Transaction Capability Authorization #63

heikoheiko opened this issue May 2, 2016 · 0 comments

Comments

@heikoheiko
Copy link
Contributor

Currently anyone can send transactions to the system. Support external KYC processes by having a restricting set of sender_addresses (users) that are granted the right to have their transactions evaluated (note sending in transactions is a different issue) by the system.

Task:

  • Write a smart contract that keeps track of the eligible users
  • Write an abstraction to check for membership in the set of users

User Registry Contract:

Stores

  • users = Map(user_address : (registrar_address, begin_block)
  • registrars = Map(registrar_address : (super_registrar, begin_block)

Contract Logic:

Users are added and removed by registrars. Registrars are added and removed by super registrars (this supports cascaded registrars). In a practical application any registrar can add any user or sub registrar that she has done real world a KYC process with, and potentially have signed agreements with. Users/Registrars can only be removed by the onboarding registrar. Note an initial admin is necessary to add the first users/registrars to the system. Every registrar is also a user. When a transaction is added to the block, it is checked if the sender_address is in users/registrars and current block_height must be >= begin_block. Users are removed by setting begin_block to -1. If users were removed their address must not be added to the system again (this restriction simplifies the contract as we do not need to maintain authorized block_height ranges).

Hydrachain/Pyethereum

Create a wrapper around validate_transaction: https://github.com/ethereum/pyethereum/blob/develop/ethereum/processblock.py#L77

The wrapper should check if the sender address is authorized for the current block_height. The chain configuration (which must have the address of the user registry contract) can be found in block.config https://github.com/ethereum/pyethereum/blob/develop/ethereum/blocks.py#L387. The wrapper should then call the original implementation. Hydrachain code needs to monkey patch processblock.py by replacing validate_transaction with validate_transaction_wrapper.

Note: Think about configuration and bootstrapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant