Ethereum in practice part 3: how to build your own transparent bank on the blockchain
Building a Transparent Bank on the Blockchain: The Final Piece of the Puzzle
In our previous two articles, we explored the creation of a token and a digital democracy controlled by these tokens using the Ethereum Wallet. Now, we're going to take it to the next level by creating a token-controlled organization, where the tokens are minted by the organization itself. This is the final piece of the puzzle in building a transparent bank on the blockchain.
Modifying the Token Contract
To achieve this, we need to modify the token contract to allow it to be minted by our DAO. We'll use the same contract we created earlier, but this time, we'll add a new field called "Central Minter." This field will hold the address of our newly created democracy contract.
To do this, upload the source code of the contract to the Ethereum Wallet and deploy a new contract. Fill in the parameters as desired, but pay attention to the "Central Minter" field. Add the address of your democracy contract to this field.
Once you've deployed the contract, go to your democracy contract and you'll notice that it now owns a million of your new coins. This is because the DAO has been granted the power to mint new tokens.
Minting New Tokens
Now that we have the token contract modified, we can mint new tokens using the "mintToken" function. However, there's a catch – only the Minter (which is currently set to the DAO address) can call this function. To get around this, we can copy the contract execution code from the "data" field and use it to create a new proposal in the democracy contract.
Creating a Proposal
To create a proposal, we'll use the "createProposal" function in the democracy contract. We'll set the beneficiary to the address of our new token, leave the ether amount blank, and add a small description to the job description field. We'll also paste the bytecode we saved earlier into the transaction bytecode field.
Proposal Checker Function
One of the key features of this proposal is the proposal checker function. This function allows anyone to check if the proposal parameters match the ones being voted on. This ensures that proposals don't get executed unless the hash of the bytecode matches exactly the one on the provided code.
Voting and Execution
Once the proposal has been created, anyone can vote on it. After the voting period has passed, anyone with the correct bytecode can ask the votes to be tallied up and the contract to be executed. If the proposal has enough support, the newly minted coins should appear on the beneficiary's account, as if it was a transfer from address Zero.
Why a Transfer from Address Zero?
You might be wondering why we're using a transfer from address Zero to mint new coins. This is because doing the opposite, sending a coin to 0x00, is a way to effectively destroy it. By using a transfer from address Zero, we're creating a new coin that didn't exist before.
Central Minter Contract
Now that we have the token contract modified and the proposal created, we have a central minter contract that exists solely on the blockchain. This contract is completely fraud-proof, as all its activities are logged transparently. The mint can also take coins from circulation by simply sending the coins it has to address Zero, or by freezing the funds on any account.
Possible Uses of the DAO
The creation of a universal stable cryptocurrency. By controlling the total amount of coins in circulation, the Mint shareholders can attempt to create an asset whose value doesn't fluctuate too wildly.
Issuance of certificates of backed assets. The coins can represent an external currency or items that the Mint owns and can prove to its shareholders and token holders. When the Mint acquires or sells more of these assets, it can burn or generate more assets to guarantee that their digital inventory will always match their real counterpart.
Digitally backed assets. The Mint can hold ether or other Ethereum-based digital currencies and use that to back the value of the currencies circulating.
Improvements Suggestions
There are multiple ways that this structure can be improved, but we'll leave it as an exercise and challenge to the reader. Some possible improvements include:
Using invitation-based membership, where each member gets a single vote.
Using quadratic voting or liquid democracy.
Making the vote a more flexible arrangement, where you can vote to postpone the decision or make a neutral vote that still counts towards the quorum.
Making the debating period proportional to the value transfer being proposed.
Creating a better token that can be automatically created by sending ether into it, which can then be retrieved by burning the token at a fluctuating market price.
What else can the DAO own or do, besides tokens?
Conclusion
In this article, we've taken the final piece of the puzzle in building a transparent bank on the blockchain. We've modified the token contract to allow it to be minted by the organization itself, created a proposal to mint new tokens, and executed the proposal using the proposal checker function. We've also explored the possible uses of the DAO and suggested some improvements. The possibilities are endless, and we're excited to see what the future holds for this technology.




