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.

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.

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.

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.

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.

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:

Pull Data from URL: https://data.police.uk/api/outcomes-for-crime/590d68b69228a9ff95b675bb4af591b38de561aa03129dc09a03ef34f537588c

(This is the example request given on the API url)

https://data.police.uk/api/outcomes-for-crime/590d68b69228a9ff95b675bb4af591b38de561aa03129dc09a03ef34f537588c (This is the example request given on the API url) Data Path: JSON Path [“outcomes”][“1”][“category”][“code”], shown below:

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.

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.