Posts

Personal thoughts on why Bitcoin is not likely to be the mainstream adoption

Two fundamental issues made me doubt the true reliability of Bitcoin. 1. Miners are not always incentivized to deter 51% attack. There is no mathematical proof that "honest nodes" always outnumber the "dishonest nodes". Because the motivation of mining coins are largely influenced by psychological factors. (e.g. bitcoins can be declared illegal by government, the miners find other more lucrative activities, therefore, less power spent on mining bitcoins). 2. The scarcity of coins is only true as far as bitcoin concerned, because the advance of technology, the odds that a new similar coin with better performance and metrics emerges is unlimited. The new coin can attract lots of mining power from bitcoin, as a consequence, the bitcoin will lose value gradually. This is same for further new advanced coins so that latest cutting-edge coin will always eclipse the monetary value of all predecessors, including Bitcoin. 

How to use bitcoinj to implement multisig transactions

Bitcoin is the dawn of the exciting blockchain technology. Although using bitcoin directly to build blockchain applications is somewhat obscure, it still can build many vivid applications based on smart contracts -- https://en.bitcoin.it/wiki/Contract . Among others, multisig technology is the cornerstone to leverage bitcoin to implement those features. The following tutorial will show how to use a popular Java bitcoin library to build transactions inherently multisig-based. Basically, it demonstrates three steps to go through whole workflow. Prepare coins. Send coins to a multisig address. Spend coins at this multisig address. The example's source code can be download via github repository: https://github.com/Bo-Ye/bitcoinj-multisig-example and the example is based on testnet. In order to build applications sitting on testnet, we should leverage following websites to assist development: https://testnet.manu.backend.hamburg/faucet https://live.blockcypher.com/btc-te

Ethereum: How To Create a Hello World Smart Contract based on a Private Blockchain

Looking at the ethereum's official Hello World tutorial -- https://www.ethereum.org/greeter , I discovered several annoyances . The example is not simple enough to be qualified as "Hello World". geth sync process is lengthy and error-prone. Network connectivity is essential to leverage.   How we can circumvent those to pave a way for an easy start in the Ethereum world? The following tutorial will provide a example to sort out those issues. In order to create and deploy a smart contract, we must have a blockchain network. Apart from the well-known main and test nets, alternatively, we can build a private blockchain that's only visible and serves locally. Prerequisites   First things first is to install some tools to carry out development tasks. install geth client. sudo apt-get install software-properties-common sudo add-apt-repository -y ppa:ethereum/ethereum sudo apt-get update sudo apt-get install ethereum  install solidity compiler.

GWT Development Environment Troubleshooting Recap

Image
Overview GWT is not for the faint hearted. Even setting up the development environment causes the numerous efforts to get it right, I sweated a lot during my own time for bootstrap of the dev env. The special part of GWT is the capability of converting the Java code to the Javascript code. In light of this methodology, GWT is not as intuitive or natural as the regular Java development or Javascript development. In the following paragraphs, I'm going to highlight the most common obstacles developers might confront when bootstrapping the GWT development. I will take this repository -- https://github.com/Bo-Ye/three-kings-gwt as the example. Run following command to download source code from Github. git clone https://github.com/Bo-Ye/three-kings-gwt.git Troubleshooting in Eclipse GWT, first of all, is a web application which follows standard web project layout and can be deployed into web container such as, tomcat, jetty, etc. The example repository is a maven web

Trade Me API OAuth Java example

Image
Overview Trade Me is the most popular online auction e-commerce website in New Zealand, which features things very much like eBay. As an e-commerce platform, Trade Me provides APIs for third-parties vendors to spark their own ideas on top of Trade Me platform powerhouse. The API reference manual is as follows:  http://developer.trademe.co.nz/ , in the reference, among others, the authentication way on basis of OAuth is very complicated, check the following link for details:  http://developer.trademe.co.nz/api-overview/authentication/example-oauth-flow/ , unfortunately, Trade Me API manual doesn't contain vivid code examples to simplify the understanding. In this article, I will list all of steps with code snippets for Trade Me OAuth flow to make it vigorous in force, therefore, projects which lies on Trade Me API are easy to get started, especially for Java. Please be aware, trade me adopts OAuth 1.0 as authentication mechanism which is not compatible with OAuth 2.0.

How to develop Tomcat-based WebSocket application on Heroku

Image
Overview When we want to develop WebSocket application based on Java, Tomcat is a good fit because Tomcat 7 and onwards support WebSocket in default. Nevertheless, Tomcat deployed on Heroku Cloud PaaS needs slight tweaks. There are two existing solutions: Embedded Tomcat :  https://devcenter.heroku.com/articles/create-a-java-web-application-using-embedded-tomcat Webapp Runner :  https://devcenter.heroku.com/articles/java-webapp-runner Unfortunately, those two solutions don't work for WebSocket applications that work under standard tomcat. The Reason why exisiting solutions don't work The critical part makes WebSocket up and running in Tomcat is two jars under lib directory --  websocket-api.jar and  tomcat7-websocket.jar , they are the implementation of JSR 356 , Java API for WebSocket, the link tells the details,  http://www.oracle.com/technetwork/articles/java/jsr356-1937161.html . If we can find those two or stuff like that with regard to dependencies r