SmartContract Test-net Walk Through and Technology Evaluation

Jonny Huxtable
9 min readDec 2, 2017

--

This article is to provide a high-level view of the current Chainlink implementation and evaluate what’s currently in-place. It’s aim is to ease understanding of the current live test-net; to provide steps to aid you in using it yourself and to speculate on what will change within the main-net launch.

All of the below article is based on the currently available information and is aiming to be as technically correct as possible (other than speculation segments). If you’re reading and spot any inaccuracies, please let me know.

Current Test-net

The current test-net is the working solution of the technology envisaged by Sergey Nazarov and Steve Ellis (smartcontract.com). It currently integrates the current version of a Chainlink node, with a centralised front-end with the intention of contract creators to be able to use the network.

Test-net URL: https://testnet.smartcontract.com
Chainlink Node Software: https://github.com/smartcontractkit/chainlink

With the above test-net URL, you are free to create an account and to use the Chainlink test-net. If you’re intrigued by the article and steps I’m taking below, feel free to have a go yourself!

Understanding Chainlinks

To use the test-net, you have to create a contract on the system. This contract contains a “Chainlink”, and there’s currently three types of chainlinks visible on the test-net, with only two of them being usable without requesting special access. Chainlinks are different blockchain connectivity options, basically your end-goal of the agreed contract, whether that’s sending a payment, or providing data into a Ethereum Smart Contract. Here’s a screenshot of this on the test-net:

Current Available Chainlinks on the Test-net

To summarise the above:

  • Ethereum Chainlink: Take data from existing systems and add it into contracts within the Ethereum Network.
  • Town Crier Chainlink: Same as the Ethereum Chainlink, but adds the data in a way that it can’t be snooped on by the node operators within the network. This is using Ari Jules’ (Chainlink Advisor) node implementation which uses Intel SGX.
  • Bitcoin Chainlink: This Chainlink is to create a contract which will release a payment to a specified bitcoin address based on the result of the contract. You can define two different addresses for whether it’s successful, or failed.

You cannot currently use the Town Crier Chainlink openly, but are free to use the Bitcoin/Ethereum Chainlinks.

(Speculation) There will be further Chainlinks available on the launch of main-net as detailed in the core-adaptor API documentation of Chainlink. From looking, this will include:

  • Being able to trigger a payable function within an Ethereum Solidity contract, to allow for direct contract communication by Chainlink.
  • Being able to determine the outcome of a contract by using Ethereum Solidity events.

Creating a Contract

This section will detail how you can create your own contract within the Chainlink test-net. Thomas Hodges (Chainlink Technology Community Manager) has already done a Youtube video on this found below:

I will break this down further to try and provide more high-level understanding of how all this fits together.

For the purpose of this example, I will be using the Ethereum Chainlink which is mentioned above. If I was to define a user story for what I’m going to achieve with this, it would read:

“As a Ethereum developer, I require to have access to the UK Police Crime Outcomes within an Ethereum contract to trigger a event based on a crime outcome”

So, let us begin!

Once you click the “Create Chainlink” button within the Ethereum Chainlink tab on the test-net, you will be greeted with the following screen:

Chainlink Tab within Create Chainlink

To summarise the following inputs:

  • Pull Data from URL: This is the URL of the JSON API in-which you want the chainlink node to query. If you don’t understand JSON API’s don’t worry, they just basically provide the data shown on webpages/in systems in a specific format to be used in other systems.
  • Data Path: This pops up a window in which you can specify which specific piece of information you’d like to use within your contract. In this case, it would be the “crime outcome” from the API.
  • Daily At: This is when the Chainlink node will query the API daily to analyse whether the contract has completed.
  • End Date: If the contract hasn’t completed before this data, the contract will be marked as failed.

The API I’ll be using is the UK Police’s API specifically crime outcomes, found here:
https://data.police.uk/docs/method/outcomes-for-crime/

I’ve entered the following in the fields:

Selected Data Path for the API Request

The daily at and end date fields don’t have much importance in this scenario, enter whatever you want!

Once you’ve got that screen filled out, you can now select the different tabs, and enter more information:

  • Description Tab: Give a title and a more detailed description for what this contract is for.
  • Attachments Tab: Give any supporting documentation to the contract. This could be a PDF of more detailed contract terms for example!

Now to the Sign & Send tab, this is where you can add other parties/individuals to agree on the contract. A screenshot of the screen:

Sign & Send Tab on Contract Creation

In this scenario, it will only provide the data to be used within Ethereum and won’t actually trigger any payment event.

If you selected a Bitcoin Chainlink, you could actually trigger a BTC payment directly with the outcome of the crime! So for example, you’d add your solicitor on here to say, if I don’t get charged/imprisoned for this crime, I will send you X BTC.

You should also see that there’s an option for keeping the agreement private within the network, and you can provide a deadline for people to sign your contract and transfer the funds to pay for the data retrieval.

Now we’re all done, click “Finalize Contract”.

Funding the Contract

Once the contract is created, it needs to be funded. In the case of an Ethereum Chainlink, the funds are for paying the node operator to retrieve the data to power your contract. You should see the following:

Contract Awaiting Funds

Due to this being an Ethereum Chainlink, once the above Ether is transfered into the Chainlinks Ethereum address, it will then retrieve the data and add that into an Ethereum contract for people to use. That’s it, data provided!

If this was a Bitcoin Chainlink, you’d need to provide the funding for the contract and then also transfer the escrow payments for when the outcome of the contract is realised.

That’s pretty much it for the test-net, but let’s talk about what can be possible.

Technology Evaluation

From reading/following the above guide, you’ve hopefully now got a understanding of how SmartContract & Chainlinks will work and how it could be used when main-net will go live. Although, there’s a lot more to talk about, and the adaptability of the Smartcontract system is endless.

Chainlink works with blockchains via adaptors, these adaptors are what the node uses to retrieve data and then also add that data back to the blockchain. There are two main types of adaptors:

  • Core Adaptors
  • External Adaptors

Core Adaptors
The core adaptors are developed and bundled within the Chainlink node software in which I linked to at the start of the article. The core adaptors consist of the most used and most common types of requests:

  • Interacting with Ethereum and Solidity Contracts
  • Interacting with Bitcoin
  • Retrieving JSON from API’s

These adaptors are the ones which power the test-net walk-through above. That walk-through retrieves JSON from API’s and then interacts with Ethereum to add that data to the network. From that, you’ll be able to see the relationship between these adaptors and then the real-world usage of them.

These adaptors are developed by the Chainlink team, and since they’re in a very modular format, they can be developed and added easily to the system. For example, they could create an adaptor to work with the NEO network to create and add contracts there, very similar to the Ethereum functionality already built in. Just think of the possibilities!

External Adaptors
Now this is where it gets interesting. External adaptors are in principle, very similar to core adaptors, but there’s one difference: They can be developed by the community!

External adaptors can be used to allow for the Chainlink network to be able to retrieve data from an unlimited amount of sources. Although, the adaptors are used for data retrieval only, they cannot be used to then write back to a service or Blockchain.

To give one example, Chainlink currently does not support XML/SOAP endpoints out of the box. An external adaptor could be developed, and most likely will be, to allow for that functionality.

You could also create external adaptors to read from Blockchains which don’t have tracker websites like etherscan or neotracker for example. This would mean being able to transfer data from different blockchain networks into Ethereum, or using data from different blockchains to trigger payments across BTC/ETH networks.

This is one of the most exciting prospects, as Chainlink nodes will develop and support more ways of retrieving data into a Smart Contract, the use-cases of the network will increase, and so does the value proposition.

Speculation

From using the test-net and gaining more of an understanding of how the Smart Contract system is put together, I’ve got some points of speculation for the future of the network and what it will look like.

Contract Funding
As the walk-through shown, the contract funding is currently in Ether and not in the LINK token. I speculate that the test-net is the implementation prior to the Chainlink ICO, and this will change upon the launch of the main-net, and subsequently the test-net updated.

I’ve seen the question asked of: Why don’t they just pay node operators in ether, why did they need an ICO?

To me, this is for various reasons:

  • Raising the capital to aid further development of implementing de-centralised oracles
  • Reserving 350mil LINK tokens as an incentive to node operators.

The 350mil tokens eludes me a little bit. Since the contract funding will be paid in LINK tokens, the people who create the contracts will be transferring LINK tokens they’ve purchased themselves, rather than from the 350mil sat in the developers wallets. So, what are they used for?

One reason could be that the 350mil tokens will be used to either automatically fund the contract. Although, this wouldn’t make too much sense, as the node operators could deliberately hike the operation prices to gauge as many of those tokens as possible if there was automatic funding.

The other reason I can think of, is that those reserved tokens will be used by the Smart Contract team to give/sell to institutions so they’ll jump on-board the network quickly. Can you imagine enterprises using an exchange like Binance to buy up tokens to use in the network? For me, it’d make more sense for the team to transfer these tokens to large institutions ready for when they want to use the network. That means that they then could pay the node-operators without much hassle. Although, they could just off-load them for ETH/BTC, but that would be very unethical.

Town Crier Implementation
Although this is visible on the test-net, not much more is known about this other than what software it will be using. I would guess that the Town Crier functionality will not be in-built into the node itself, more so node operators who want to support this variety of Chainlink will have to run a Town Crier node separately on Intel SGX support hardware (Latest Intel Chips), and then connect that with their existing node.

Core Adaptors
Since core adaptors are used for the writing back to a blockchain and the test-net only currently supports ETH/BTC, Hyperledger is missing. This is shown on the main Smart Contract website.

It is known that SWIFT is currently using Hyperledger for their DLT, so I’d wager a guess that the Hyperledger adaptor is still under wraps as the partnership develops further and they won’t publicly release any information around that until it becomes final.

Chainlink will come into play here as SWIFT will need to use their existing systems to send information across hyper-ledger, and that’s what Chainlink is perfect for.

Summary

After using the test-net and reading into the Chainlink network, I’m excited for the possibilities of what this project can provide for the entirety of the blockchain space. Since it’s not specifically tied to any current blockchain project, it can move with the times and include support for new technology when it needs to while keeping the core concept the same. Due to that and its potential ability to work with any blockchain, I see it as the premier Oracle solution in the market today.

--

--