Smart Contracts Sharing Common Data

This article discusses why and how some Solidity smart contracts share common data.

Jules Goddard
Coinmonks
Published in
12 min readSep 7, 2020

--

Photo by Kitty West

There are many possible models of interaction between multiple smart contracts. In the example for this article, we consider a simple Producer to Consumer model, so that we can focus on the theme of sharing common data:

Typical Producer to Consumer model

For example, the Producer could be a bank providing mortgage products. The Consumer could be the auditing department.

The Producer and Consumer model may be required because:

  1. the Producer and Consumer work at different rates
  2. the Producer and Consumer work on different timelines
  3. the Producer and Consumer are different contracts, developed by different teams or at different times
  4. a host of other reasons

In this model, the Producer will produce a data object which is sent to the Consumer to consume when they are ready to do so. That is, the two smart contracts must handle the same data object, but at different times.

--

--

Jules Goddard
Coinmonks

Experienced high-integrity software engineer, crypto code compactor and Datona Labs founder — providing smart contracts to protect your digital information.