I’m delivering two talks at Microsoft Ignite Australia on Blockchain development

I’m excited to be delivering 2 talks at Microsoft Ignite Australia this year, both of them are on Blockchain development. I’ll be able to share my experience so far with developing solutions on the Blockchain with some of our customers.

Blockchain 101 & Azure Blockchain as a Service

https://msftignite.com.au/sessions/session-details/2485/blockchain-101-azure-blockchain-as-a-service-cld213
You keep hearing about the Blockchain, but do you really understand what it is, and the potential impact it will have on practically all industries? Join us as we cover: What the Blockchain is, Some scenarios showing potential use cases to put it into context, and then how Azure Blockchain as a Service can help you get started today.

Blockchain Development on Azure Blockchain as a Service

https://msftignite.com.au/sessions/session-details/2484/blockchain-development-on-azure-blockchain-as-a-service-cld424
This deep dive session will show the frameworks and tools you can start using today to develop Blockchain based applications and smart contracts. Then how to use the Azure Blockchain as a Service to configure a private consortium, or development Blockchain environment. This is a level 400 session, it is HIGHLY recommended that you attend the Blockchain 101 session before this. I’ll be utilising the Truffle framework http://truffleframework.com/

 

 

Meetup Madness & Kids coding open to all at Microsoft Ignite pre-day

Microsoft Ignite is just around the corner. But there are some events that are open to all if you happen to be on the Gold Coast.

MeetUp Madness

Microsoft is proud to bring together 7 technical communities from all over Australia to host MeetUp Madness.  Join likeminded professionals in an informal gathering talking all things tech. Topics will cover SQL, Cloud/Azure, .NET, Xamarin X-Platform development, Office 365, SharePoint, Data Science and Infrastructure. Take the opportunity to learn something new, meet those with similar interests and it wouldn’t be a MeetUp without pizza, beverages and swag. This event is open to everyone and all are welcome. All MeetUps will be held concurrently, so choose one that takes your fancy and RSVP at https://www.meetup.com/en-AU/Microsoft-events-in-Australia/

Magikcraft Kids Coding: Can Garry Pottr save the world from the Zombie Apocalypse? 

Microsoft is partnering with BizSpark Startup Magikcraft to host a kids coding event on Monday 13th February at the Gold Coast from 4-6pm.  Using Minecraft, kids will learn to craft JavaScript spells and join the hero of the Magikcraft universe, Garry Pottr, as he versus the Zombie Apocalypse to save the world.  Kids aged 8 -14 will learn how to cast lightning bolts, fly through the air, and finally face the Zombie Horde.  As well as a fun way to learn to code, this is an actual, legit, official Guinness Book of World Records event.  We will be setting the world record for the most Zombies killed by JavaScript lightning in a period of ten minutes.  Places are limited, so get in quick and register now. https://www.eventbrite.com/e/magikcraft-zombie-apocalypse-learn-to-code-set-a-world-record-tickets-31439588656

Also – Here’s details of the Zombie Apocalypse Leader board (using Azure functions) which will be displayed during the event: https://twitter.com/sitapati/status/826531378049060866

Ethereum DevOps with Truffle, TestRPC & Visual Studio Team Services

I have been working on automating the compilation and testing of Ethereum solidity contracts, via the use of Truffle. I’ve got the test results being published back into the portal, allowing me to see on each commit if my code still compiles and passes my tests.

image

I’m assuming you already have a Truffle project locally that you want to automate the continuous builds & testing on. Follow my tutorial on installing Truffle & TestRPC on Windows.

My final system will allow you to run “truffle test” locally to see standard test output, but will modify the test runner on the server to output it as JUnit format.

The Build system

The system uses the Visual Studio Team Services (VSTS) build engine to automate this. You can sign up for free, and get unlimited private Git repos.
You can have the code hosted on any Git provider. So either within VSTS itself, or GitHub, BitBucket, etc.

Prepare truffle.js

A pre-step is to define the  test section in the truffle.js file

mocha: {
reporter: “spec”,
reporterOptions: {
mochaFile: ‘junitresults.xml’
}
}

image

Create a build agent

VSTS does provide hosted build agents, which are generic and can build standard .Net projects, Xamarin, etc. But because we are going to use npm packages installed globally on the box to handle the Truffle builds

  • Create a new Windows VM (Can be your own hosted server, or Azure).
    e.g. Windows Server 2016 Datacentre edition on Azure
  • Install the VSTS build agent. Instructions at https://www.visualstudio.com/en-us/docs/build/admin/agents/v2-windows
    Note: DON’T select to run service as NT AUTHORITY\NETWORK, this will not work with TestRPC (needs to open ports).
    Run the service as another user, or NT AUTHORITY\SYSTEM
  • Install chocolatey
    https://chocolatey.org/install
  • Install these chocolatey packages
    • choco install git -y
    • choco install nodejs.install –
  • Install npm packages (make sure you open a new PowerShell window so that node is in your path)
    • npm install -g npm
    • npm install -g –production windows-build-tools
    • npm install -g ethereumjs-testrpc
    • npm install -g truffle
    • npm install -g mocha
    • npm install -g mocha-junit-reporter
  • Restart the build agent so that all new paths are working

Configure VSTS build

    • Create a new variable with the path to where the npm global path is, for the user you installed the npm packages on above
      variable name: npm.path
      variable value: path to npm packages e.g. C:\Users\<user>\AppData\Roaming\npm
      image
    • Add 7 PowerShell tasks, and configure them like this
      • Name: System version information
        Script:
        #Setting environment paths
        $ENV:Path = $ENV:Path + “;” + $env:npm_path
        npm config set prefix $env:npm_path    #only needs to be set once, will update for user
        #DEBUG
        #$env:path
        #npm list -g –depth=0
        #Display system information
        Write-Host “System version information”
        Write-Host -nonewline    “node version: ” ; node -v
        Write-Host -nonewline    “npm version: “; npm -v
        Write-Host -nonewline    “npm prefix: “;  npm prefix -g
        Write-Host -nonewline    “truffle: ” ;    truffle version
        image
    • Name: Config transform & test clean
      Script:
      # remove old test results
      rm .\junitresults.xml -ea SilentlyContinue
       

      # Modify the Truffle test runner to use the JUnit reporter
      Rename-Item .\truffle.js .\truffle_temp.js
      cat .\truffle_temp.js | % { $_ -replace ‘reporter: “spec”‘, ‘reporter: “mocha-junit-reporter”‘ } | Out-File -Encoding ASCII .\truffle.js
      rm .\truffle_temp.js
      image

    • Name: Truffle build
      Script:
      #Setting environment paths
      $ENV:Path = $ENV:Path + “;” + $env:npm_path
      #Truffle build
      truffle compile
      image
    • Name: Launch TestRPC
      Script:
      #Setting environment paths
      $ENV:Path = $ENV:Path + “;” + $env:npm_path
      # launch the process
      echo “launching TestRPC”
      $testrpcProcess = Start-Process testrpc -passthru
      # persist the PID to disk and display in logs
      $testrpcProcess.Id | Export-CliXml testrpcPID.xml
      cat testrpcPID.xml

      image

    • Name: Run Truffle tests
      Script:
      #Setting environment paths
      $ENV:Path = $ENV:Path + “;” + $env:npm_path
      # Run the tests
      truffle test
      image
    • Name: Shutdown TestRPC
      Other Settings: Enable “Always Run” (to make sure it is shutdown if there is an error)
      Script:
      #Setting environment paths
      $ENV:Path = $ENV:Path + “;” + $env:npm_path
      # retrieve the PID and kill the entire processs tree
      cat testrpcPID.xml
      $testrpcPID = Import-CliXml testrpcPID.xml
      taskkill /pid $testrpcPID /F /T
      image
  • Add a new Publish test result
    • Test Result Format: JUnit
      Test Result Files: junitresults.xml
      image

 

Future work

Things that I would like to add in the future:

  • Figure out how to automate this on a Linux build agent (VSTS supports both Windows & Linux based build agents)
  • Automate Release Management to run “truffle migrate” to push to a Bletchley test environment

Configuring Visual Studio code for Ethereum Blockchain development

Visual Studio code is a great tool for editing Solidity smart contracts, and is available on Windows, Mac & Linux. There is a great plugin that enables Syntax highlighting, snippets, and compiling of the current contract (if you aren’t using an external tool) https://github.com/juanfranblanco/vscode-solidity/

This configuration works really well with Truffle (as shown in the final screenshot). You can read how to install Truffle on Windows in my previous post https://davidburela.wordpress.com/2016/11/18/how-to-install-truffle-testrpc-on-windows-for-blockchain-development/

Step 1: Install Visual Studio code
https://code.visualstudio.com/

Easy option on Windows: Just install via https://chocolatey.org/ by using the command
choco install VisualstudioCode –y

Step 2: Install Visual Studio extensions
Go into the extensions section, then install these plugins:

  • solidity
  • Material Icon Theme

image

Step 3: Enable icon theme
File –> Preferences –> File Icon Themeimage

Final result: Sexy workspace
image

How to install Truffle & TestRPC on Windows for Blockchain development

I have been doing a bunch of Blockchain development work, one of which was recently featured on the front page of the Australian Financial Review and on Microsoft’s news website.

One of the trickiest things has been trying to get Windows environments correctly configured, as the tools are npm based and want to be compiled natively and assumes it is on a Linux machine. Here is the simplest install script I have found

Step 0. Pre-step:

Step 1. Install windows tools with chocolatey:
Open a PowerShell prompt as Administrator

image

Step 2. Install the tools via npm:
Open a NEW PowerShell prompt as Administrator (to ensure that it reloads )

  • npm install -g npm
  • npm install -g –production windows-build-tools
  • npm install -g ethereumjs-testrpc
  • npm install -g truffle

You may see some error messages during npm installs. Many of these are just informational / optional components failing. You can test that it is all working by trying to run the commands truffle and testrpc.
imageimage

 

Bonus Step: combining with Visual Studio Code
This is how I use Truffle & Visual Studio code together. Make sure you install and configure Visual Studio Code with the Solidity extensions.
If you navigate into the folder where your files are, typing “code .” will open Visual Studio Code in the current folder. Running the command after a truffle init gets you up and running quickly

image
image

Microsoft Research video of a ‘smart’ tattoo that acts as a device controler

I saw this article on The Verge that I wanted to share http://www.theverge.com/circuitbreaker/2016/8/13/12460542/mit-microsoft-research-gold-leaf-smart-temporary-tattoo

Below is a short video that gives an overview of the technology. It shows a quite sensitive and fairly accurate temporary tattoo that you can apply to your skin to control an interface on a device like your phone or PC. The designs of the tattoo can be as aesthetic as you like, as they are cut out like a stencil.

I think the designs and future potential as wearable tech is really cool. I’d love to see this taken further than just a research proof of concept.

Blockchain summit report: Day 2

Final day. I’m tired from 6 days of sessions, and many of the sessions today were more high level “we are a bank / enterprise that are looking into what the cloud can do for us”. So I skipped taking notes for a lot of them.

Sessions

Factom. Blockchain Technology tools for net gen asset systems
Most of old asset records are paper based, difficult to update.
Databases are too easy to modify. Blockchain is a happy medium.

They have a way to do document tracking on Blockchain.

Zcash
Issue is privacy on the Blockchain. It is a giant shared database, everyone can see what you are transacting. Like trading securities.
Possible solutions: Private chain, restricted read access.

Could try to do it off chain and put hash on chain, but then the blockchain is just a timestamping service.
Encryption can hide the values, but not the people.
Ring encryption can hide the people.

Zero-knowledge security layer. Enables private transactions. Supports “Selective disclosure”.

What the 2 parties see: Alice sells 1,0000 MSFT to Bob at USD 97.123

What the trade repository aggregator sees (selective disclosure): <blank> sells 1,0000 MSFT to <blank> at USD 97.123

What everyone else sees: <blank> sells <blank>  to <blank> at <blank>

Internet has a security encryption layer (SSL).  Cryptography (SSL) was required to let the Internet grow.
Blockchain needs a security layer (ZK security layer)

Plans on releasing their zCash Blockchain on Oct 28

Bloq
http://bloq.com/
Bringing Enterprise to Blockchain
Trying to be like Redhat for Blockchain. Enterprise support 24/7, security fixes, monthly subscription.

“Blockchain operating system”. On-premises software stack.

Open Bazaar
https://openbazaar.org/
Open distributed trade market. With no fees.
Ebay & Taobao are C2C (Consumer to Consumer) trade platforms.
Has an escrow style payment system. Buyer puts money into escrow, merchant sends, buyer releases from escrow.

Ebay is completely centralised. Every communication goes through Ebay and you pay them for the privilege.
Open Bazaar is distributed, you talk direct to each other.

Challenges of Building Decentralised markets: P2P software more complex than standard websites. Designing incentives to encourage users to act responsibly. Ensuring software is secure & reliable. Translate difficult tech into mainstream user experience.

Benefits of buying & selling on OpenBazaar: sell ANYTHING you want, anywhere (some things just aren’t available for purchase in that country). No buyer or seller fees. No data collection by 3rd parties. No restrictions on how you operate your business. Market of moderators that compete to provide quality dispute resolution.

Can purchase weird things like hot sauce, and North Korean cigarettes.

Version 2.0, you can purchase digitital goods (music, videos) and get it delivered instantly. Great for sellers as they will get to keep all the revenue, and not lose the 30% cut that iTunes takes.

Chronicaled
A turnkey solution to securely connect physical goods to a Blockchain.
Blockchain benefits for IoT are incresingly recognized by developers and enterprise, and hundres of potential physical world use cases have been identitifed.
The lack of a turnkey solutoin to securely connect and engage with assets with assets on chain is a huge barrier to development.

Turnkey solution: Ethereum smart contracts. BLE & NFS microchip inventory. Custom, secure chip firmware. Registration & authentication SDK. Open registry explorer. Tamperproof form factors so people can’t functionally remove the chip.
Device sends a challenge to the chip. Private key securely stored in the chip signs the challenge.
Signed challenge is compared to public key stored on Blockchain.
Has an open registry explorer (blockchain explorer)

Use cases: Authenticity & provenance. Handbags, fine art, wine, collectible sneakers, event ticketing.
Atomic financial transactions. New sharing economies. Micro & peer to peer insurance. Collateral & security. Physical world affiliate networks.
Machine to Machine interaction. Drone with a chip flies to a garage, it is recognised as being whitelisted, the garage door opens.

Everledger
Provenance means “the history of something”. It’s life story. Is very important for luxury items like artwork.
You may have the expensive thing, but may have misplaced the certificate of authenticity.
Digital global ledger to track items of value.
Currently tacking diamonds (write its unique dimensions, physical properties, faults, etc. gives it a unique ID).
Later if they are stolen and tried to be sold elsewhere, then can grab them.
Currently 98,000 diamonds tracked on their Blockchain.

Can track provenance to track origins of rough diamonds, through to polished stone. To ensure that they don’t come from conflict areas.
Can have IoT enabled diamond analysis devices, that can auto get the properties and look up its authenticity in the Blockchain.

Augur
http://Augur.net
Prediction platform built on Ethereum.

Would be cool to ask Siri/Cortana a generic question like “who will win the US presidential candidate will win the US presidency?”.
Predication market works by creating a market on a question. You purchase a share in the prediction, then if you predicted correctly, you get your share of the pool.
“wisdom of the crowd”. The average answer that comes out of a crowd is usually consistently better than an expert.

Stellar
International remittances of money transfers are expensive, with long delays. Legacy payment systems are expensive, complicated and slow.

Used to be unreliable to send email to each other, needed to manually specify routes. But SMTP made it a simple open protocol that anyone could use. Why hasn’t this been adopted for payments?

Bitcoin allowed sending money as a single network.
They want Stellar to be the protocol to send money from any 2 points, through any payment network. Like Alice pays Bob, but it goes through Bitcoin network, through Dash, then pays Bob in Doge.