EOS Bank Contract
Eos bank
Any user who wishes to use or send EOS on the EOS blockchain needs an account. Due to the inherent cost and limits on accounts that the network can have, I propose a smart contract that will work as the middle man between the EOS blockchain and users without accounts
Key pieces:
- Bank contract & account
- Relay account/s
- Key pair (EOS/RSA/ECC/...)
Definitions
Bank contract
Smart contract that will:
- Hold a table of users
- Enable transactions with the users funds
- Handle automatic delegation of resources and ram purchases
Relay account
The relay accounts will be public accounts without funds, used to communicated with the blockchain.
Key pair
The user will need to create a key pair using a supported key, this will be used to sing the transactions that the user wants to perform and will be relayed to the bank contract by the relays
Scenarios
A user wants to withdraw EOS from the exchange
- The user creates a key pair
- Withdraw the funds to the bank contract, adding the public key in the memo
The user wants to transfer funds on the bank
- The user creates an action that includes the details of the transaction (from, to, quantity, random number, signature of previous parameters)
- The user send this action using any relay account
- The bank contract will validate the signature, add the random number as used (to prevent replay attacks) and execute the action
Allocation of resources
This contract will need bandwidth for the actions and ram for the account storage.
- The bandwidth could be offered by some third party to support the contract or on last resort the bank contract could stake the received funds.
- For RAM, as it not renewable, will be payed out by the user. When the user does a deposit and creates a new account the contract will try to buy ram to hold it’s account (from 200-600 bytes). When the user withdraws all the funds and the account is removed, the ram will be sold and the value returned too.
Advantages
- Ram cost is recoverable and lower
- Users don’t need to be on the chain to receive a transaction
Congratulations @alepacheco! You received a personal award!
Click here to view your Board
Congratulations @alepacheco! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!