MENU

Remix MSTORE bug

February 12, 2019
0
167
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
91
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
600
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
1051
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
1269
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
1487
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
1692
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
1782
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
2162
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
2415
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
2547
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
2693
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
3094
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
3679
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 ›

Understanding The ICO Landscape Podcast with Jose Mota from OST

October 10, 2018
0
3422
0
I had the opportunity to share my knowledge on Tokenomics talking about tokens, ICOs and blockchains with podcaster Jose Mota. Check it out below. https://medium.com/ostdotcom/recap-from-ost-live-with-tokenomics-author-sean-au-understanding-the-ico-landscape-ed498d4700a0 https://itunes.apple.com/us/podcast/ost-live-blockchain-branded-tokens-and-token-economies/id1432951800?mt=2#episodeGuid=http%3A%2F%2Fwww.blubrry.com%2Fostlive%2F38114241%2F  
Read More ›

How long does it take to do geth sync?

October 6, 2018
0
4502
0
Here are some latest stats on how long it takes to synchronise with the Ethereum blockchain. Geth can run in 3 modes. Fast, full or light. In light mode, geth gets only the current state. To verify elements, it needs to ask to full (archive) nodes for the corresponding tree leaves. Light > geth --syncmode=light will take about 15-20 minutes and take about 500Mb of disk space. The starting block was about 300,000 blocks behind the current block. Fast In fast mode, which is the default so no flag is required, it can take a bit of time. It gets the block headers, the block bodies, it processes no transactions until current block - 64(*). Then it gets a snapshot state and goes like a full synchronization > geth For me it took 1 hr to download 60% of the blockchain but the remaining 40% took another 5 hrs. It currently takes ~120 Gb of HDD.   Full Fully mode will take over 1Tb in storage and will take forever to sync. Currently sync’ing so TBA.   The specs of my laptop is: The Internet connection was around 50Mb/s (Wireless home fibre)   Ref: https://ethereum.stackexchange.com/questions/11297/what-is-geths-light-sync-and-why-is-it-so-fast
Read More ›

Tokenization: It isn’t new but it is the future

October 2, 2018
0
3910
0
I had the opportunity to publish a piece in the Crypto AM publication where the audience of City A.M. (of which Crypto AM is part of) is sophisticated/high net worth/qualified City of London workers with  315,000 daily readers in print. As the Crypto winter maintains its steady grip on token prices and the ICO craze of 2017 has all but subsided, for now at least, many are wondering what to make of all these tokens that now float around in cyber space? In this article we look at the emergence of all these tokens in this tokenized economy, if the concept is really new and what’s installed in the next few years. Blockchain technology has enabled a large wave of enormous innovation with respect to the creation of these so called “utility tokens”, which are essentially promises that they can be redeemed at some point in the future for a product or a service. With over 1,600 tokens and counting, they all have created their own miniature economies battling for investors, developers and users and of course promised the masses that their Blockchain platform or application is the one that will solve the most relevant problems in today’s society. Problems […]
Read More ›

Wellington Hashgraph Meetup #3

September 27, 2018
0
3993
0
We hosted the 3rd Wellington Hashgraph meetup a few days ago and had some international guests from around the world. About 15 people turned up so we are slowly growing (some new faces) and again, food and drinks were provided as well. We had developers Magnus Bondesson, Chi Hao Poon, Jonas Wallenius and Patrik Åkerlund join from Sweden to talk about their interesting game called BlockWars. (https://blockwars.live/) BlockWars is a map based war game running on the Ethereum blockchain and the team is looking to port this over to Hashgraph. The idea is to conquer the world by owning territory similar to the board game Risk. Above you can see Morne owning some territory in New Zealand and it was attacked by one of the BlockWars guys. Afterwards we had Shiv Aggarwal, CEO of  MyEarth.id talk about this project of creating an decentralised identity management system. It is an ambitious project and they raising capital. Afterwards, there was a good discussion about the up and coming hackathon and developers conference where we are looking to live stream the event. The next meetup is scheduled for October 17th 2018. More details can be found at: H18 – Hedera Hashgraph Developer Conference Wednesday, Oct […]
Read More ›

Wellington Blockchain Meetup September 2018

September 20, 2018
0
4294
0
It was time for another get together of the community and to see who the true dedicated enthusiast were in amidst this crypto winter. Only about 20 people turned up but the topics were certainly very interesting. Jevon gave an update on Cryptfolio.com, a site that keeps track of your crypto portfolio, and how all your trades can be pulled from various sources to help your accountant deal with tax. Although prefaced with the disclaimer that this was not financial or legal or tax advice, in NZ, each trade is considered a taxable event and needs to be tracked. Jevon even walked through several examples and there were great questions from the audience. Jevon gave a demo of extracting a bunch of trades from various exchanges and exporting it as a CSV. Then we had Andy from Horizon State talk about their new charity app Coin Pocket (https://coinpocket.hs.app). What was interesting was a tweet from Nimo, co-founder of Horizon State. Two #blockchain meetups this week. Two different countries. Two fire alarms go off. The only thing in common was me 😂😂😂 #blockchainflowerkids in da house!? — Nimo Naamani (@nimo_ni) September 20, 2018 We had an alarm of some sort go […]
Read More ›

An intro in the world of ISO/TC 307

September 13, 2018
0
4797
2
My first foray into the ISO world came in the form of helping companies attain ISO 9001, Total Quality Management. This is the stamp of approval indicating that a company is following good practices and procedures usually in the manufacturing industry. I spent some time looking at the ISO 27000 series when I was a briefly a Certified Information Systems Auditor (CISM) and then I learnt the entire NZ Electricity Act 1992 (the regs) and the AS/NZS 3000 for the electrical industry. Having studied (not invested unfortunately) blockchains since 2014, when ISO/TC 307 blockchains and distributed ledger technology came out I jumped at the chance to get involved. I had been in contact with Standards NZ and contributed to New Zealand upgrading its status from an O member (Observing) to a P member (Participating). It was very challenging at first because you indicate from a list of topics what interests you and your Standards body rep registers you to various groups. Then you get hammed with all sorts of emails and there is no one to help “onboard” or explain what all of this means. In May 2018 there were 7 Study Groups (SG) and 3 Work Groups (WG). ISO/TC […]
Read More ›