MENU

Sydney Edcon 2019 Wrap

April 19, 2019
0
13
0
The week of April 8th was Blockchain week in Sydney with many blockchain events culminating in Edcon where Vitalik and his research crew shared their vision of Ethereum 2.0 The Hackathon The week started out with a hackathon at the University of New South Wales (UNSW) where there were lots of teams hacking it out for various cash prizes. What is funning is the story of CryptoChicks. One of the most inspiring team was CryptoBeast mentored by a good friend Nick Addison who entered his son and 3 of his mates. They were all 11 years old and ended up coming third! The most important question though is what do you do with a 6 ft cheque of $2000? Well, it may not provide much warmth as a blanket but it sure does look good! On Wednesday evening, ConsenSys put on an event at Tyro Fintech Hub with a number of guest speakers. Edcon Thursday was when Edcon started and boy did it start with a bang. It actually started with a hilarious rap! The schedule was very full on where the heavy hitters dominated the first day. You had to bring your thinking caps though because some of the […]
Read More ›

All you need to know about 2^256

April 8, 2019
0
270
0
How to pronounce 2^256? 2^256 is pronounced “two to the power of two hundred and fifty six”. What does it represent? Computers represent numbers in binary. Here is an example where we have 2 bits, where each bit can represent a ‘1’ or a ‘0’ allowing us to produce 4 possible combinations:00 = 001 = 110 = 211 = 3 The formula “2^number of bits” gives us the range of numbers that we can represent. So 2^2 = 4, which is true from the table above where we have 4 possible values. (In computers, we start counting from ‘0’) If we have 3 “bits” then we have 9 possible combinations (ie 2^3=9):000 = 0001 = 1010 = 2011 = 3100 = 4101 = 5110 = 6101 = 7111 = 8 If we have 256 ‘bits’, then we have 2^256 possible combinations which is a really large number! What does 2^256 look like in decimal? 115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,936 OR1.158 x 10^77 (this is 1.1 with 77 zeros after it). Source: https://defuse.ca/big-number-calculator.htm How do you pronounce 2^256? 115 quattuorvigintillion 792 trevigintillion 89 duovigintillion 237 unvigintillion 316 vigintillion 195 novemdecillion 423 octodecillion 570 septendecillion 985 sexdecillion 8 quindecillion 687 quattuordecillion 907 tredecillion 853 duodecillion 269 […]
Read More ›

Sydney Hashgraph Meetup

March 28, 2019
0
444
0
It was great to finally attend the Sydney Hashgraph meetup and meet some of the organisers. We had Jason Loh and Edgar Seah dialled in to provide an update of Hashgraph and how mainnet is going to be launched very soon. This summer in fact. The audience was quite small but that is normal nowadays as the speculative hype has died down and only the true enthusiast remain. It is fascinating to also note that the Hashgraph consensus algorithm is asynchronous Byzantine Fault Tolerant, ie the gold standard of consensus algorithms. It has also been mathematically proven. The technology is still relatively new and there is still more to understand about it but it is exciting to see the progress.
Read More ›

Static and Symbolic Analysis

March 15, 2019
0
679
0
Static Analysis Static analysis can be described as a way to test code without actually executing it. The idea here is to use a computer program to analyse a program’s source code without running it. Static analysis has a few sub components such as Flow Analysis. This tracks how values might flow between the different memory relocations in a program. Tainted Flow Analysis is often referred to where untrusted input is considered tainted, eg input from a user and conversely, hardcoded values or constants are untainted. Flow Analysis can have “sensitivity” added to increase the precision and also to reduce false positives. It basically accounts for variables whose contents change, typically by using extra qualifiers. Context Sensitivity Analysis is another sub component of Static Analysis where calling other functions can cause false positives. “So context sensitive analysis solves this problem by distinguishing call sites in some way, so that we don’t allow a call at one place to return it’s value to another call.” Symbolic Analysis Symbolic execution aims to generalise testing so that instead of testing with actual values, tests are run with variables. The image below explains it best. Concolic testing is another term often thrown in when discussing symbolic execution or symbolic analysis. […]
Read More ›

Fascinating POA & IBFT blockchain papers to read

March 9, 2019
0
1173
0
If you are trying to understand more about Proof of Authority consensus, Instanbul Byzantine Fault Tolerance (IBFT) or just blockchain consensus protocols in general, just jump straight into some research papers. It may seem daunting at first and it actually is but these papers are well written where sufficient background is provided to slowly build up a good understanding of other fundamentals. Here are key excerpts from the three papers I read. IBFT was developed by AMIS technologies in early 2017. [1] IBFT consensus protocol falls in the PoA category because only a set of special nodes, called validators, are authorised to propose new blocks. [1]. For more info on IBFT visit: https://github.com/ethereum/EIPs/issues/650 (this was inspired by EIP225 (link below)). The set of validators in PBFT is static whereas in IBFT they are dynamic [1] A private blockchain is a special permissioned blockchain operated by one entity. ie within one single trust domain. [3] Aura and Clique are two popular PoA algorithms. [2] Aura and Clique are two popular PoA implementations. [2] For more information on Clique, visit: https://github.com/ethereum/EIPs/issues/225 A blockchain is a linked data structure replicated over a peer-to-peer network, where transactions are issued to form new blocks. Peers […]
Read More ›

Training trainers at SK in Korea

February 25, 2019
0
1750
0
I had opportunity to provide blockchain train the trainer to SK Global in Korea which is another level up from regular training. SK Global or SK Holding is one of the largest conglomerates in South Korea comprising of around 95 subsidiaries. SK Global has more than 70,000 employees and 113 offices worldwide. My esteemed colleagues Coogan and Luiz, travelled to Korea in December and provided blockchain training to SK. They did an amazing job which pathed the way for part 2 of this training. I arrived on Sunday morning after taking the red eye from Sydney to Tokyo and then connecting to Seoul. I had to be rerouted due to weather conditions at Sydney airport but that is another story in itself. Seoul was cold! It may not feel like it if you’re only outside for a few minutes but very quickly you can feel your ears tingle. On day 1 we went through the plan for the week and reviewed the 1 day non technical edition as well as the first day of smart contracts for developers. The trainees had already gone through the material so this served as a refresher and provided more opportunities for in-depth discussions on […]
Read More ›

Remix MSTORE bug

February 12, 2019
0
1791
0
I was looking into strings v bytes into a bit more detail and started comparing the gas consumption between them. The following code was used: pragma solidity ^0.5.0; contract StringVersusByte { string constant _string = "hello"; bytes32 constant _bytes = "hello"; function getAsString() pure public returns(string memory) { return _string; } function getAsBytes() pure public returns(bytes32) { return _bytes; } } After deploying, I executed the the getAsBytes() first and saw that the execution cost was 196 gas. I then looked to confirm this by stepping through the debugger and summing up the cost of all the op codes. What I discovered was that it summed up to 172 and not 196 gas. I was out by 24 gas. I then looked at the debugger and looked at the remaining gas field. It should reduce by the amount of gas but in step 3 it doesn’t. It reduces by 12 instead of 3 as can be seen in the video. The culprit opcode is MSTORE and there are 2 MSTORE which makes up the missing 24 gas. In the video, the remaining gas decreases by the expected amount until it reaches step 3. This issue is highlighted as a bug […]
Read More ›

Some Merkle Tree resources

February 1, 2019
0
1664
0
Here is a great infographic from YunYun Chen from ConsenSys originally published at: https://media.consensys.net/ever-wonder-how-merkle-trees-work-c2f8b7100ed3 Here is a link to a 10 page research paper called “A digital signature based on conventional encryption function” by Ralph C. Merkle in 1988. https://people.eecs.berkeley.edu/~raluca/cs261-f15/readings/merkle.pdf This is a 7 page paper on “Providing Authentication and Integrity in Outsourced Databases using Merkle Hash Tree’s” https://people.eecs.berkeley.edu/~raluca/cs261-f15/readings/merkleodb.pdf
Read More ›

EVM Illustrated

January 24, 2019
0
2202
0
Here is a neat 116 slide deck that goes through what Ethereum is, the EVM and how it all works by Takenobu Tani. It is a pretty useful explanation but does go into a lot of detail such as endian and byte addressing which is quite low level. Here is a link to the pdf and here is the GitHub.
Read More ›

Where is DeployedAddresses.sol?

January 11, 2019
0
2707
0
If you are creating test scripts in solidity, you may have come across these import statement: import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/HelloWorld.sol"; The last one is easy to understand because it is your smart contract in the “contracts” folder but what about Assert.sol and DeployedAddresses.sol? First of all, “truffle” refers to the global truffle repo which can be found at usr/local/lib/node_modules/truffle. Assert.sol lives at: usr/local/lib/node_modules/truffle/build/Assert.sol The trick is, what about DeployedAddresses.sol? You won’t find this file in the global truffle repo and a terminal search will be chocolateless fruitless. The reason is because this file is dynamically created at test time. (Kindalike the geth.ipc file that gets generated when geth is running but disappears when geth is stopped). “truffle” is a meta package, ie “these packages do not contain actual software, they simply depend on other packages to be installed“. In fact, if you look at the deploy.js source code, you’ll see the DeployedAddresses file get created via the code. Source: https://github.com/trufflesuite/truffle/issues/471 https://github.com/trufflesuite/truffle-core/blob/b3ad375993ec42bc622c7674258edc7614944482/lib/testing/deployed.js https://askubuntu.com/questions/66257/what-is-the-difference-between-a-meta-package-and-a-package
Read More ›

Truffle Box at URL … doesn’t exist

January 2, 2019
0
2977
0
If you have just created a new folder and ran truffle init and got an error similar to below truffle init Downloading… Error: Truffle Box at URL https://github.com/truffle-box/bare-box.git doesn’t exist. If you believe this is an error, please contact Truffle support. at Request._callback (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-box/lib/utils/unbox.js:50:1) at Request.self.callback (/usr/local/lib/node_modules/truffle/build/webpack:/~/request/request.js:185:1) at Request.emit (events.js:189:13) at Request. (/usr/local/lib/node_modules/truffle/build/webpack:/~/request/request.js:1157:1) at Request.emit (events.js:189:13) at IncomingMessage. (/usr/local/lib/node_modules/truffle/build/webpack:/~/request/request.js:1079:1) at Object.onceWrapper (events.js:277:13) at IncomingMessage.emit (events.js:194:15) at endReadableNT (_stream_readable.js:1107:12) at process.internalTickCallback (internal/process/next_tick.js:72:19)   then try to do “npm uninstall -g truffle” and then “npm install -g truffle”. When I did this I got: Preparing to download ✔ Downloading ✔ Cleaning up temporary files ✔ Setting up box Unbox successful. Sweet! Frustrating that it happened in the first place!
Read More ›

IIB Council Certified Blockchain Professional

December 28, 2018
0
3090
0
I finally managed to pass my IIB Council Certified Blockchain Professional exam. I had been putting it off since August as I was flat out with up-skilling and delivering Enterprise Ethereum training. I had been in conversations with IIB Council earlier on in the year and got hold of the study materials in July 2018. The train the trainer process was very professional. I reviewed the initial draft 241 slide deck and then received the study guide. The study guide was protected with a license that was only valid for 30 days and disabled the copy and paste feature along with printing capabilities. Clever! Then came the proctored exam which was well executed as well. It had to be booked 3 days in advance and had to be taken in a room with a clear desk. A chrome extension had to be installed which unfortunately required access to my camera, mic and other functions as well. At the examination time, an examiner (a real person) would log on and control my computer to turn off screen capturing features and recorded my screen. I then had to use my webcam to show the examiner the walls of my room, my desk […]
Read More ›

Understanding basic functions in solidity

December 22, 2018
0
3342
0
Smart contracts are comprised mainly of functions so it is important to understand how to construct one and all the various options available. From the solidity documentation, the syntax of a function is as follows: function FunctionName([parameters]) {public|private|internal|external} [pure|constant|view|payable] [modifiers] [returns (<return types>)] What this means is that when creating a function, here are the required steps. Use the function keyword Provide a function name Provide parameters if required Set the function’s visibility. There’s 4 options to choose from. public, private, internal, or external: Set the behaviour of the function. Choose from view, pure, or payable. Add any applicable modifiers Add any applicable return types/parameters Here is a brief explanation of the different visibilities. Public: All (contracts can a call the function) Private: Only this contract Internal – only this contract and contracts deriving from it External – Cannot be accessed internally, only externally. Private is a subset of internal and external is a subset of public. For a more detailed and intriguing analysis of the difference between public and external check this. (TLDR: public uses more gas because it uses memory instead of calldata). Check the docs more details The behaviours are defined as: View: Can read the state but will not modify storage state […]
Read More ›

What does semantic versioning have to do with Solidity

December 17, 2018
0
3261
0
Considering that the very first line of a solidity smart contract is something like: pragma solidity ^0.4.21 What does the caret really mean? The short answer is the caret or top hat (^) means the code will be compatible with compiler version from 0.4.21 to 0.5.0. This sounds easy to understand but it doesn’t actually tell the whole story. To really understand it, means learning about the concept of Semantic Versioning. In short, software versioning generally follows the format major.minor.revision. The caret is only one symbol out of various others such as ~ (tilde), * (wild card), || (logical or) and a bunch of typical ones such as >, >=, < and <=. The real definition of ^ is: “Allows changes that do not modify the left-most non-zero digit in the major.minor.version tuple format.“  This definition explains the following examples: ^1.2.3:  >=1.2.3 and <2.0.0 ^0.2.3: >=0.2.3 and <0.3.0 ^0.0.3: >=0.0.3 and <0.0.4 Tilde is interesting. The definition is: “Allows patch-level changes if a minor version is specified on the comparator. Allows minor-level changes if not.” which again is explained by these examples: ~1.2.3:  >=1.2.3 and <1.3.0 ~0.2.3: >=0.2.3 and <0.3.0 ~1.2:>=1.2.0 and <1.3.0 (Same as 1.2.x) ~1: >=1.0.0 <2.0.0 (Same as […]
Read More ›

Checklist for developing smart contracts

December 15, 2018
0
3794
0
To start developing smart contracts in solidity, here is a check list of applications that will make your life easy. Note: Instructions here are geared towards Mac operating system. Remix Remix is an online Integrated Development Environment (IDE) where solidity smart contracts can be written. It can then be compiled and tested locally or combined with Metamask and deployed on testnet for instance. Editors – Atom or Sublime Atom or Sublime are popular editors. Atom is open source (ie free) while Sublime costs $80USD. While solidity smart contracts are written in remix, editors are useful to handle json, javascript and regular text files. Metamask Metamask is a browser extension that allows smart contracts to connect to various blockchains. It can be thought of as a bridge connecting the two together. Geth Geth or Go Ethereum is an Ethereum client which when run, acts as a node to connect to the Ethereum blockchain. It can be configured to point to mainnet, testnet or even set up in private mode. The following command will tell you if you have geth installed or not. > geth version Geth Version: 1.8.14-stable Architecture: amd64 Protocol Versions: [63 62] Network Id: 1 Go Version: go1.10.3 Operating […]
Read More ›

Blockchain Training with Union Bank in Manila

December 5, 2018
0
3994
3
I had another opportunity to deliver a 5 day blockchain Ethereum developers course to Union Bank in Manila. Union Bank have been exploring blockchain technologies for a while and have several projects on the go. They created a blockchain institute which is part of their CSR program and invited students to apply. They had hundreds of applicants and filtered them down to 100. ConsenSys Academy was then invited to train the students. The students already had 9 days of training from NEM prior to us and will also have Hyperledger and Corda training in the New Year as well. Day 0 I had the option of arrive at either 5:30pm or 10:30pm and luckily choose the earlier option even though it was more expensive. This was because the flight eventually touched down at 7pm and it took 30 minutes to get my luggage and figure out how to order a Grab taxi. Even getting to the Grab taxi took a while coz when the taxi arrived in the “no pick up zone”, it was shuffled off and I had to figure out where it went to and how to get their. The ride took 90 minutes to cover ~15km due […]
Read More ›

Blockchain training with LG in Korea

November 9, 2018
0
4042
0
Even as the crypto market continues to tank, the technology that underpins it is still going strong. Lots of very smart people are working very hard behind the scenes and lots more want to learn about blockchains. I had the chance to help train LG CNS (Consulting and Solutions, one of the business units) who were particularly interested in Quorum which is used for creating permissioned blockchains. From our hotel room we could see the many buildings of LG CNS. Security was very tight. Not surprising as it was around their R&D facility. We had to go through airport style x-ray scanners when leaving the building every day and have our laptops checked to make sure the serial number matched the one we registered with them.   The biggest challenge was actually the fact that we had a Korean interpreter for the entire 5 days. We had to speak slowly, clearly and pause after a few sentences to let the interpreter do her thing. It certainly did make things interesting! I teamed up with Carlos, who is the Global lead of Enterprise Education at ConsenSys Academy and has amazing knowledge of blockchains and is a world class trainer. Day one […]
Read More ›

Chilling out with Tyler from Viant

November 2, 2018
0
4280
0
After our presentation at Proctor and Gamble, where Tyler, the co-founder of Viant (a blockchain-based platform for modeling business processes, tracking assets and building the supply chains of the future), demonstrated the platform with a hands on demo, we took the opportunity to have lunch at the local markets. The food available was amazing, especially the Hainan Chicken but we did sample a whole range of dishes. Viant is a very neat solution and is making great progress in the blockchain supply chain space. Keep an eye out for more announcements at https://viant.io/
Read More ›

Blockchain 101 for Proctor & Gamble Singapore

October 26, 2018
0
4715
0
I had the opportunity to present a blockchain 101 to Proctor and Gamble in Singapore recently trying to engage an audience for an hour talking about ConsenSys, consensus and all things blockchains included concepts such as blockchains v distributed ledgers, cryptocurrencies v tokens, and of course use cases. Proctor and Gamble have launched a digital transformation program to learn more about disruptive technologies of which blockchains is one of them. The whole week was part of their ONWARD program where staff could attend all sorts of training in the area of their interest.   After I finished, Tyler Mulihive, the co-founder of Viant talked about their blockchain-based platform for modelling business processes, tracking assets and building the supply chains of the future. The attendees also managed to create an example supply chain application for themselves which was really neat.   Tyler, Michael Teo, (P&G Senior IT Manager for IT Innovations) and I. I also managed to have lunch with some of the awesome Singapore ConsenSys crew at WeWork at Suntec city. The office is a very nice space.  
Read More ›

CareChain NZ: Blockchain in Healthcare Symposium

October 14, 2018
0
5308
0
I had to the opportunity to contribute to CareChain NZ: Blockchain in Healthcare Symposium in Auckland recently that was brilliantly organised by Tom Varghese and Tech Futures Lab. Mark from Blockchain Labs NZ kicked the evening off with a Blockchain 101 talking about what is distributed ledger technology, how does it work, and how can blockchain help healthcare. Mark had a great example of explaining trust and decentralisation using neighbourhood trading using trusty “Harold” (love the name!) who Alice and Bob have known for a long time as an example. Blockchain enables Harold to be removed from the equation. Next was Shahid Saiyad from IBM talking about what applications blockchains have the most promise in healthcare. IBM have put significant efforts in the blockchain space. The funniest talk of the evening had to go to Jerome Faury from Centrality. He kinda set the scene from the beginning with his t-shirt! Katherine Noall from Sphere Identity shared fascinating blockchain insights for identity management in healthcare. Kris Vette from Chain Ecosystem discussed the options to enable blockchain adoption and success in healthcare and what factors influence the scalability of blockchain projects. Alex Sims talked regulation and privacy (a topic she could talk […]
Read More ›