Parent & Child Architecture for BlockChain System

Parent & Child Architecture for BlockChain System

BlockChain has the potential of bringing the biggest IT revolution of this century or at least first half of this century. After Internet revolution, last century, BlockChain revolution is probably the biggest disruption so far which is challenging the weakest nerve of Internet: of being Trust less. BlockChain is the only technology known so far which can bring trust on a trust less internet. Blockchain brings this trust by making data practically immutable.

 

Ethereum currently is one of the most widely used BlockChain system used so far. Ethereum too make data immutable in order to create trust among nodes. Now when we say that Ethereum makes data immutable that means that not only the values which is stored becomes immutable but also the program or smart contracts becomes immutable. And that means that if one has deployed a smart contract on Ethereum, whatever may have happened he/she will not be able to update or modify the same.

 

So, immutability of data comes at a cost and the cost is any future update of smart contract will not be possible which is practically not workable for many use cases. But if we design smart contracts in certain fashion then partially this problem can be resolved.

 

The proposed architecture solution will work as a parent and child model. As a first step, we can deploy a parent smart contract and this parent contract will have the feature of storing any other contract address and calling that contract using the contract address. Now whenever we deploy a new child contract we can update the parent contract with the address of new child contract and then parent contract will be able to call the child contract. The only limitation here is that the structure of child contract should be known to the parent contract i.e. number of inputs going into child contract and number of output coming out of child contract should be known to the parent contract before deployment of parent contract.

 

Let’s take an example of calculator in order to explain this architecture better. Let’s say that we want to build a calculator with following functionality on day one –

  • Add two numbers
  • Multiply two numbers
  • Store the result of all the operation and never lose the data

 

In order to build a calculator with above functionality we first need to deploy a parent contract and this parent contract will have following features –

  • Call any child contract which can take two numbers and return one number
  • Ability to store contract address
  • Ability to store return result in state variable

 

Once parent contract with above functionality is deployed then one will need to deploy two child contracts, one with add function and one with multiply function. Both these functions will take in two numbers and will return the result and will not store anything in the state variable. Once child contract is deployed, address of these two contract will be updated to the parent contract. Now parent contract can call these two contract and can store the result. This way we have fulfilled the requirement of building a calculator.

 

Now after some time the user of the calculator decides that he/she do not want add functionality but a subtraction. Also, its already a requirement that no data should be lost. If we try to deploy a new parent and child contract, then we will lose all the data stored by the old parent contract which is undesirable. But since we have followed parent and child model, what we can do is we can deploy another child contract similar to add child contract which will do subtraction and once deployed update the parent contract with the address of this new subtract child contract. This way we will be able to update the functionality of the calculator smart contract and data stored is still immutable.

 

Below is the diagrammatic explanation of calculator example.

As a first step deploy Parent contract with specified functionality. Parent contract will contain the state variables and only business logic will be present in the child contract. During the design phase of the parent contract it is required to identify all the state variable which will be used in present and can be used in future.

Deploy another child contract with add functionality.

Deploy another child contract with subtract functionality.

Connect Parent contract with both the child contract.

Now in order to remove add function and add subtract function, first let’s deploy subtract contract.

Now remove the connection with Add contract and add the connection with subtract contract. As required, anytime connection to the add contract can be added back again. Also, if parent contract was designed keeping future in mind then may be subtract contract can be added as an added functionality along with Add and Multiply.

48 Comments
  • Posted at 8:01 am, March 24, 2017

    It’s really a nice and helpful piece of info.
    I am glad that you shared this helpful info
    with us. Please keep us up to date like this. Thank you for sharing.

  • Posted at 9:34 am, April 3, 2017

    I just couldn’t go away your website prior to suggesting that I actually
    enjoyed the standard info an individual provide to your visitors?

    Is gonna be back often in order to investigate cross-check new posts

  • Posted at 5:16 pm, April 11, 2017

    I simply want to say I am just beginner to blogging and actually liked this web-site. Most likely I’m likely to bookmark your blog . You actually have superb writings. With thanks for sharing with us your web-site.

  • Posted at 12:06 am, April 14, 2017

    Wow! This could be one particular of the most helpful blogs We have ever arrive across on this subject. Basically Great. I am also an expert in this topic so I can understand your effort.

  • Posted at 9:41 am, April 14, 2017

    Hola! I’ve been reading your site for a while now and finally got the courage to go ahead and give you a shout out from Huffman Tx! Just wanted to say keep up the excellent job!

  • Posted at 10:29 am, April 14, 2017

    It’s actually a cool and helpful piece of information. I am glad that you just shared this helpful information with us. Please keep us up to date like this. Thanks for sharing.

  • Posted at 8:01 pm, April 16, 2017

    I just want to tell you that I am just beginner to blogging and seriously savored you’re web blog. Likely I’m going to bookmark your blog post . You absolutely have amazing article content. Thanks a bunch for revealing your web-site.

  • Posted at 4:18 am, April 22, 2017

    Exceptional post however , I was wondering if you could write a litte more on this subject? I’d be very thankful if you could elaborate a little bit more. Bless you!

  • Posted at 6:13 am, April 22, 2017

    Hey here, just turned out to be conscious of your blog page through Bing and yahoo, and found that it is really entertaining. I will appreciate should you continue on this post.

  • Posted at 6:37 pm, April 22, 2017

    Incredibly informative resources that you have remarked, thank you for posting.

  • Posted at 9:40 pm, April 22, 2017

    I really want to reveal to you that I am new to blog posting and incredibly cherished your webpage. Very possible I am prone to bookmark your blog post . You absolutely have amazing article blog posts. Delight In it for expressing with us all of your site webpage

  • Posted at 11:27 pm, April 22, 2017

    This is proper day to make some goals for the foreseeable future. I have looked over this blog posting and if I can, I want to propose you handful entertaining recommendation.

  • Posted at 4:54 am, April 23, 2017

    I merely need to tell you that I am new to blogging and incredibly cherished your report. Very possible I am prone to bookmark your blog post . You literally have amazing article blog posts. Appreciate it for swapping with us the best internet site webpage

  • Posted at 3:35 am, April 24, 2017

    Absolutely enjoyable data you’ll have stated, many thanks for writing.

  • Posted at 3:05 pm, April 24, 2017

    Gday there, just started to be receptive to your blogging site through Yahoo and bing, and realized that it is truly good. I will like if you decide to continue on this informative article.

  • Posted at 6:34 pm, April 24, 2017

    I am not sure where you are getting your information, however good topic. I needs to spend a while studying more or working out more. Thank you for magnificent info I used to be searching for this info for my mission.

  • Posted at 6:34 pm, April 24, 2017

    I have been examinating out a few of your stories and i must say pretty nice stuff. I will make sure to bookmark your website.

  • Posted at 6:35 pm, April 24, 2017

    I am also commenting to make you be aware of of the extraordinary discovery my friend’s princess enjoyed studying your web page. She learned a lot of issues, most notably what it’s like to possess an awesome coaching heart to have many people effortlessly comprehend a variety of tortuous matters. You undoubtedly did more than people’s expected results. Many thanks for offering those great, dependable, explanatory and even fun guidance on your topic to Mary.

  • Posted at 6:56 pm, April 24, 2017

    You completed a few nice points there. I did a search on the matter and found mainly people will have the same opinion with your blog.

  • Posted at 7:14 pm, April 25, 2017

    It happens to be right occasion to construct some goals for the long-run. I have looked over this post and if I can, I desire to suggest to you you very few important advice.

  • Posted at 5:39 am, April 26, 2017

    Incredibly entertaining details you’ll have remarked, a big heads up for publishing.

  • Posted at 11:55 am, April 26, 2017

    Is it okay to put part of this on my webpage if I post a link back to this webpage?

  • Posted at 1:42 pm, April 26, 2017

    Wow! This could be one particular of the most useful blogs We have ever arrive across on this subject. Actually Excellent. I am also a specialist in this topic so I can understand your effort.

  • Posted at 2:00 pm, April 26, 2017

    Unbelievably informative information you have said, a big heads up for writing.

  • Posted at 5:40 pm, April 26, 2017

    I simply intend to show you that I am new to blogging and incredibly liked your website. More than likely I am likely to save your blog post . You seriously have great article materials. Admire it for telling with us your current blog document

  • Posted at 11:09 pm, April 26, 2017

    I really want to show you that I am new to wordpress blogging and clearly adored your website. Very possible I am inclined to save your blog post . You indeed have extraordinary article materials. Delight In it for discussing with us your very own site write-up

  • Posted at 11:28 pm, April 26, 2017

    Heya there, just got aware about your web page through Bing, and realized that it is seriously useful. I will be grateful should you continue on these.

  • Posted at 10:03 am, April 27, 2017

    This is very interesting, You’re a very skilled blogger. I’ve joined your rss feed and look forward to seeking more of your wonderful post. Also, I have shared your website in my social networks!

  • Posted at 5:46 pm, April 27, 2017

    Thank you so much for giving everyone remarkably pleasant opportunity to check tips from this blog. It is often so lovely and full of fun for me personally and my office mates to visit your blog on the least thrice in 7 days to study the newest guidance you will have. And of course, I am also at all times fulfilled for the remarkable tips you serve. Some two areas on this page are absolutely the most beneficial we have had.

  • Posted at 6:21 pm, April 27, 2017

    I have been browsing on-line more than 3 hours as of late, yet I never discovered any fascinating article like yours. It’s beautiful value sufficient for me. In my opinion, if all site owners and bloggers made excellent content material as you did, the net will be much more helpful than ever before. “Perfection of moral virtue does not wholly take away the passions, but regulates them.” by Saint Thomas Aquinas.

  • Posted at 7:59 pm, April 27, 2017

    Hey here, just became aware of your article through Bing, and discovered that it’s very informative. I’ll take pleasure in if you carry on this informative article.

  • Posted at 1:42 am, April 28, 2017

    Wow! This could be one particular of the most beneficial blogs We’ve ever arrive across on this subject. Actually Excellent. I am also an expert in this topic so I can understand your hard work.

  • Posted at 1:45 am, April 28, 2017

    Whats Going down i’m new to this, I stumbled upon this I’ve found It positively helpful and it has helped me out loads. I’m hoping to contribute & aid different customers like its aided me. Good job.

  • Posted at 2:34 am, April 28, 2017

    Helpful info. Lucky me I found your website accidentally, and I’m stunned why this accident didn’t took place earlier! I bookmarked it.

  • Posted at 2:36 am, April 28, 2017

    Good write-up, I am regular visitor of one¡¦s blog, maintain up the excellent operate, and It’s going to be a regular visitor for a long time.

  • Posted at 2:36 am, April 28, 2017

    Nice blog here! Also your site loads up fast! What web host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as quickly as yours lol

  • Posted at 2:39 am, April 28, 2017

    I have been browsing online greater than three hours today, yet I never found any fascinating article like yours. It is lovely price sufficient for me. Personally, if all web owners and bloggers made excellent content as you did, the net can be much more useful than ever before.

  • Posted at 2:53 am, April 28, 2017

    Thank you for all of the labor on this site. Betty takes pleasure in working on research and it is simple to grasp why. We learn all relating to the lively tactic you provide sensible tactics through your website and even increase response from other individuals on that topic while our favorite daughter is without a doubt learning a lot. Take pleasure in the remaining portion of the new year. Your carrying out a glorious job.

  • Posted at 7:29 am, April 28, 2017

    Excellent read, I just passed this onto a friend who was doing a little research on that. And he just bought me lunch as I found it for him smile So let me rephrase that: Thank you for lunch!

  • Posted at 10:10 am, April 28, 2017

    Our company have been sleeping on 2 from these for about 2 weeks right now, They are actually actually nice! I wish they maintain their shape for several years as well as don’t sag where the sleeper exists.

  • Posted at 11:30 am, April 28, 2017

    It happens to be the best occasion to prepare some desires for the upcoming. I’ve scan this document and if I should, I want to suggest you handful appealing recommendations.

  • Posted at 1:46 pm, April 28, 2017

    you are in point of fact a excellent webmaster. The site loading speed is incredible. It sort of feels that you’re doing any unique trick. Furthermore, The contents are masterwork. you’ve performed a wonderful activity in this matter!

  • Posted at 4:49 pm, April 28, 2017

    I will immediately seize your rss feed as I can’t find your email subscription hyperlink or newsletter service. Do you have any? Please permit me realize so that I could subscribe. Thanks.

  • Posted at 12:33 am, April 29, 2017

    Greetings here, just turned out to be familiar with your web page through Search engines like google, and realized that it’s quite entertaining. I’ll be grateful if you decide to persist these.

  • Posted at 4:43 am, April 29, 2017

    I have to show my passion for your kind-heartedness supporting people who must have help with your concept. Your very own commitment to getting the message along appeared to be extremely invaluable and have continuously enabled many people like me to attain their dreams. Your own informative tutorial entails a great deal a person like me and even more to my office colleagues. Many thanks; from everyone of us.

Post a Comment

Comment
Name
Email
Website