Author: andylockran

Blockchain; gateway to cryptography?

“What is a blockchain?” is probably one of the most frequent questions I’ve had to answer in the last 12 months.  What makes it more difficult is the answer more often than not has to take into account the varied knowledge and experience of the inquirer.

I’ve got a reasonable background in understanding the cryptography ecosystem from my days at a systems administrator, and having to secure everything from PII through to credit card data.  What I am not though, is a cryptography expert.  It’s a perfect example of  where you can rely on the experiences and expertise of other people in the open source community, rather than mixing your own flawed implementation.

What I’ve realised is that Blockchain is pretty much a gateway to cryptography.  Many people up until now will have used the simple padlock system in the top left of the address bar as their only real exposure to cryptography; but with cyber attacks becoming more and more frequent, the tacit knowledge required for the average user probably needs to improve.

To that end; when people are now asking for me to explain blockchain so they can understand it; I sort of reverse the question.  The ‘distributed ledger’ is a pretty easy concept to explain with an append-only google docs spreadsheet.  Where I think the general knowledge starts to falter is on hashes.  I’m not going to cover it in this article, but looking up what one-way cryptographic hashes are is probably the first element of Blockchain 101.

Once you’ve got a grasp of what a hash is, it’s then worth understanding how to secure them. The simplest answer (in my experience) is to rely on someone with experience to tell you which is the best hashing strategy to use, and get them to cite the source for that decision.  Internet security is rapidly evolving, so the right answer 2 years ago is the wrong answer now, but in starting to understand how the answers are reached, even non-technical participants can start to look for warning signs on outdated cryptographic techniques.

The second thing that I suggest people then look at is the concepts of Merkle trees. You can use both of these principles to either create a daily hash of your accounts spreadsheet file, or a Merkle root of the file as a representation of a semi-manually computed blockchain.  Simply share/publish your calculation at the end of each day so another party has access, and you can begin to understand the trust mechanisms that operate once the system starts to scale up.

Finally, you end up with the genesis block (ironic that genesis is at the end of my explanation) – and understand that everything starts from an agreed ‘state’ – not necessarily 0.  Once these three concepts are covered, you should have a working knowledge of blockchain.  If there’s more you want to know (or disagree with me on) – please let me know in the comments.

HTML5 App development

I’ve always been a fan of the concept of HTML5 app development, mostly due to the fact that I knew little Java/ObjectiveC in order to be able to even begin to do native.

That said, in the past 12 months I’ve been able to help out on an iOS app developed in ObjC & Swift; and then a hackathon where we used some neat networking tricks to create the “Internet of Christmas Jumpers” – more on that in a post later in the year.

One of the frameworks I’ve been following for a while is Ionic, and it doesn’t disappoint.  One of the nicest surprises though has been the IDE functionality built out more recently in VSCode.  The cordova-tools extension to VSCode is absolutely fantastic to play with:

I can click and drag on that phone in the bottom right to mimic accelerometer data.  Of course; to tweak the right values you need to play around with a device in the real world – but it’s a neat ‘accelerator’ to places where you require native functionality integration.

The other thing that’s pleasing me more is the developments of Progressive Web Apps, therefore the ability to run a mobile site and download the page/functionality without having to pass through the stringent requirements of individual app stores.  Most ‘apps’ I write are throwaway ideas, rather than productised moneymaking things – and the ability to run these as PWAs allows me to ignore much of the device integration – and focus on the HTML5 bits.

As browser APIs start to provide more and more in depth functionality; the need to do ‘native’ integration is passed over to the Cordova library for performance, and with the wonderful work of the open source community in keeping this every improving, we can be confident that this will continue to be ‘good enough’ for quite a while.



Freedom to do evil?

One of the key paradoxes about freedom is the freedom to do both right and wrong.  We balance freedom with laws that restrict certain freedoms by providing limits on what society regards as acceptable.  In a completely open model, those freedoms can be used for both good and evil.  Despite being of a liberal mindset, I also understand that we must take responsibility for our own actions, which may mean balancing our own freedoms against our responsibilities to our fellow man.

With the announcement today that Facebook, Google & Microsoft are teaming up to block extremist content on the internet, should we be concerned that such technology could also be used to restrict access to any content?  If Donald Trump doesn’t like a particular news article about him, can he get it blocked?

One of the most clearly concerning episodes from the recent US election is that conversation is being channeled into separate media – rather than having a balanced debate on a platform, echo chambers on both sides of the argument are being setup to polarise opinion.  Twitter is blocking the ‘alt-right’ and fascist behaviours, only for that community to move over to a new platform,  The liberal left are unlikely to want to join the platform, so the problem is exacerbated.

Does ‘Freedom of speech’ on the internet require a new paradigm?  Whilst media censorship has been an accepted means of protecting the liberty of groups and individuals in protecting against vile, fascist and immoral diatribes from groups that make the majority of us uncomfortable – does the communication revolution of the internet mean that we can no longer use these old methods to protect our citizenry?

I’m unclear as to whether there’s an answer, or whether the answer is unacceptable to our traditional values.  We cannot create a ‘clean’ internet without gagging certain views, and in doing so we’re giving the control to whom?  The technology companies are immature as far as moral and ethical codes go, so maybe we need to lean on other organisations that have more experience in ethical/moral frameworks to help shape the better model of intervention?

Embracing imperfection

Perfection is not attainable, but if we chase perfection we can catch excellence.
— Vince Lombardi

As a consequence of both election results, in the UK with #Brexit and in the USA with #Trump, I have found myself thinking about the impact that the role I play in society has on such events. I’ve worked in ‘technology’ for most of my career, minus a short career break for some quasi-philanthropic charity work in India. Given the attention given to issues such as #fakenews and social media #echochambers – it does appear that the role of modern technologists is quite substantial.

I was attending the #WebSummit conference when the news broke that #Trump had won the US election. I was surrounded by 50,000 people of whom the majority seemed shocked and despondent at the result. There were some passionate speeches, incredulity at the result, and a real sense of bitterness at those who had exercised their democratic freedoms to elect #Trump. However, like with #Brexit, I felt the need to turn the mirror on myself and question what I had contributed.

One of the topics of conversation at #WebSummit was on Robotics and the ethical dilemmas created by new humanoid technologies. Ben Goertzel, from Hanson Robotics debated strongly against Andra Keay, from Silicon Valley Robotics, espousing the laissez-faire approach to ‘suck it and see’ and deal with the ethical dilemmas as they appear – whereas Andra proposed spending time to contemplate a code of ethics before the jump is made.

I admire Andra’s approach, but for me this code is decades too late.

Media, communication & social interactions are all things that affect our emotions, decision making and world-views – even without a human face. The power of books and films to elicit strong emotions is just as powerful when read on or Facebook. With traditional media, we understand the implicit contract so beautifully articulated in Yes, Minister! by Jim Hacker*, we question the stories and understand the biases if not quite accepting that we’re affected by them. However with Facebook, Twitter & other online communities we’ve been tricked. We expect them to be passive commentaries on our social circles, not biased media outlets, shaped to affect our emotions. Technology strategists like Nir Eyal seek to focus on modifying behaviour; using digital cues to affect real-world actions. Where was the debate around ethics for non-robotic technology; surely this is as relevant a field as the new humanoids we’re creating?

Just because we can do it, does that mean we should?

In the world of science, this question is used to temper progress. Without understanding the consequence of our actions, we should not seek to blindly continue. This doesn’t mean we have to answer all the unknowns, nor does it mean not take risks. It does mean that we should have a thought for our own safety, and the safety of others before continuing down that road. Ironically President Obama gave a wonderful speech on the 17th October, about how the government cannot be run like a Silicon Valley startup. His pertinent message included reference to the following:

So sometimes I talk to CEOs, they come in and they start telling me about leadership, and here’s how we do things. And I say, well, if all I was doing was making a widget or producing an app, and I didn’t have to worry about whether poor people could afford the widget, or I didn’t have to worry about whether the app had some unintended consequences – setting aside my Syria and Yemen portfolio – then I think those suggestions are terrific.
— President Obama

So perhaps it’s not government that’s broken; perhaps some of the bureaucracy is good? In technology and start ups we solve problems; we’re progressing to find near-perfect solutions to particular problems, without contemplating how some of the brokenness serves a function. We destroy low-skilled jobs in the name of automation, without thinking about how to provide purpose to those who would quite happily take on those low-skilled tasks for financial reward. We disrupt low-margin business models by disinter-mediating those who cannot provide a robust defence and let big businesses who’d fight back off the hook.

Let’s as a community start to look before we leap and to make sure we’re benefitting the whole of society; not just ourselves.