Today we're going to show you an example
of how a business might use Hedera's Consensus Service, HCS for short, and to
be clear this is not a packaged application that you would buy and
deploy. It is simply an example that outlines the components one might use with
Hedera Consensus Service. Today's demonstration is driven by a fully
pluggable application scaffolding SDK extension components that will
ultimately support several sample use cases and on top of this scaffold we
have created a very simple application network, or appnet for short, for payment
settlement and audit. There are three layers
everybody should consider when seeking to exploit the Hedera network. The first
is the mainnet. In September of 2019 the Hedera network was made open to the
world, open access and from this state anyone anywhere has been able to build
on the mainnet, a global trusted public network with the highest known level of
security, Asynchronous Byzantine Fault Tolerance, or ABFT for short, attack
resistant and able to come to consensus independently in a matter of seconds.
Importantly, unlike other networks, Hedera
does not store history therefore Hedera and several third parties have launched
mirror nodes so that transaction history can be managed.
While mirror nodes do not participate in consensus mirror nodes can provide a
public record of transactions and history. In addition memory nodes offer
flexibility for the owner to choose what to store and for how long. So the mirror
node is a means for storing and retrieving transaction history long
after the record has ceased to exist on the Hedera mainnet. And finally, we have
the concept of an application network, or appnet for short. An appnet is simply
software that is executed collectively across Hedera's global public network.
These applications interact in order to achieve a specific common goal or task,
settlement between airlines for example, or payments between two organizations or
Importantly, the parties that interact do not need to trust one
another as they inherit the trust from the network. Trust in the order of
transactions, the time they happen, and the proof that
they occur. So let's take a look at a particular example of an appnet
leveraging Hedera Consensus Service (HCS). A payment and settlement appnet. In our
example Alice and Bob are two users running an app on their devices. These
devices might be servers or smartphones pretty much any device really. In this
example Alice wants to send a message which could be as simple as hi Bob or a
business message like those seen in traditional enterprise architectures or
a hash of some file. She sends a business message over Hedera Consensus Service to
any Hedera node, specifically to the topic associated with this appnet.
Hedera nodes reach consensus on the message and order it fairly. Importantly,
Alice and Bob do not need to trust one another as they inherit the trust from
the network just as importantly Alice and Bob may choose to encrypt the
message so that only they and potentially an auditor or an arbiter can
read them. This is important and this ensures the messages remain totally
private over the public network.
So we have secured private communication over
a public network together with a verifiable audit log with fair
time-stamping of private transactions. This is extremely powerful, both Alice
and Bob received the message from a mirror node when Alice receives the
message she knows that it had been time stamped by Hedera and consensus reached.
When Bob receives the same message he can act on that message but for this
example he simply replies with an acknowledgment. Looking slightly deeper
at the process we can see how mainnet nodes, mirror nodes, and appnets
interact. In this payment settlement example parties propose and agree
credits and debits through messages sent from the appnet.
In our example there
are three subscribers Alice and Bob who exchanged IOU's for payment of course
these are individuals but could easy represent two airlines settle on
codeshare agreements hotels banks whatever and of course our auditor,
Farouk. When Alice wishes to transact with Bob she does so by submitting an
encrypted message to the HCS topic on a Hedera mainnet node.
The Hedera mainnet node gossips to other nodes until final consensus is reached in just
a few seconds and the message has a fair timestamp. Mirror nodes see the new message
and publish it to topic subscribers Alice Bob and Farouk our auditor. The
messages are then decrypted. When Alice sees her own message she knows it has
reached consensus. Bob then replies to Alice acknowledging receipt of the
message. He does so by submitting another encrypted message to the same HCS topic
on the Hedera mainnet node and the same process occurs. Once again as you can see
from the flow messages may be encrypted using standard proven encryption methods.
Methods designed to keep information private and secure.
So here I am in the example settlement
and payments appnet. On the left hand side of the screen I have my Alice user
and on the right hand side of the screen we see Bob. In reality while these two
users are on the same screen they are in fact running as two totally separate
docker images. Therefore they could be anywhere in the world on any device. So
let's initiate a credit from Alice to Bob. As you can see Alice and Bob have
really been sending credits from one another, so I create a credit for Bob.
Let's see now, credit Bob, how much shall we credit Bob today? Let's credit Bob say two
thousand five hundred US dollars here we go two thousand five hundred US Dollars
and we'll put in a quick note here another IOU. So yes I submit that credit
and we see something extremely powerful two users who do not necessarily know and
trust one another transacting across the Hedera public
network. I can accept other credit – let's see now here's a credit from Alice
we'll accept that's one jolly good we'll confirm that one and here's a second
credit from Alice and yes we'll accept that one too – great
that's previous credits accepted.
So as previously described what is actually
happening is that the messages are sent to an appnet specificity HCS topic via
Hedera node using the Hedera Consensus Service. Hedera then fairly
orders each transaction with 100% consensus finality, not probabilistic, not
waiting for a set of blocks, real finality. The Hedera nodes then see each
message and publish them to subscribers within the appnet. Precisely what we
have seen today. Fantastic so from a simple credit I can move into a simple
settlement process here we can see that Alice owes Bob three thousand dollars
and Bob is owed three thousand dollars by Alice. Let's have a look at this and settle.
Alice clicks on settle puts in a simple message to Bob let's have a look settle
with Bob great ok she's proposing to settle the outstanding three thousand
dollars. Fantastic settle request sent but what does Bob see? So I click on
settlements for Bob I look at Bob settlements I see open up Alice look at
Bob settlement and I can see that yes indeed Alice has proposed to settle the
outstanding three thousand dollars so I can accept that proposal.
Let's see now I accept and I confirm accept great confirmed and then on
Alice's side I see that Bob has indeed accept the proposal and I can now
propose a payment channel Bob can an accept the payment channel an ultimately
payment can be made in fiat, crypto, whatever they both decide.
great accept – simple secure business messaging between two users sending
credits and debits privately across the Hedera public network. Of course, for
demonstration purposes these processes are manual but in the real world much of
this will be automated. But let's have a look at another user we've spoken
previously about audit so let's have a look at Farouk our audit user. Here I am
as Farouk authorized to decrypt and see the recent set of messages between Alice
and Bob the settlement proposal the acceptance and the payment channel
proposal. Looking at the settlement proposal message number 42 on topic ID
ending in 179909, Farouk can see all the detail needed for audit purposes. It's a
settlement proposal the payer is Alice, the recipient is Bob, the amount is three
thousand US dollars, we can see the date. By opening the message further we can
see detail of the centers time stamp. Right the way down to the nanosecond, we
can see the HCS message itself and again the associated topic ID 179909 but we spoke about secure private messaging over the public network.
have a quick look at the same message as any other non authorized user may see it.
Let's switch over to a third-party mirror node, in this case Kabuto.
Okay here we are let's search on 179909 pick
message number 42 the message we looked at previously and what can we see of
value? Absolutely nothing just encrypted digest so there we have it a simple
payments and settlement appnet secure business messaging between two users
across the Hedera public network great.