Scriptless Script

April 6, 2019

TL;DR, Scriptless Script was initially invented to solve the problem of encoding smart contracts in Mimblewimble where signatures are the only way to express ownership. A key observation is that the aggregation and substraction of the schnorr signatures can be used to capture the semantics of a class of offchain protocols, leaving blockchain as an engine for verification as opposed to computation. This not only enables the smart contract capabilities for systems like Mimblewimble, but can also be used to improve the efficiency, fungibility and privacy of other blockchains such as Bitcoin.

Read More

Payment Channels in Lightning Network

February 16, 2019

One of the fundamental aspects of the lighting network protocol is how payment channels are established and utilized to transfer funds. Just like TCP connection, payment channel is virtual in the sense that it is achieved by carefully designed smart contracts which gives user the illusion that there exists a channel. In this post, the smart contracts expressed in Bitcoin script in different types of transactions within the lightning payment channel are discussed in details, with graphs illustrating their potential behaviors under different scenarios.

Read More

An Incomplete Survey of Bitcoin's Privacy Technologies

February 4, 2019

TL;DR, Bitcoin has never been anonymous since its inception. Making it more private becomes one of the most vibrant research areas in the space. While some proposals have made (or are making) their way into the Bitcoin’s reference implementation, others were either implemented in altcoins or get abandoned altogether. In this post, the following privacy enhancing technologies are categorized and surveyed based on the information they are trying to hide.

Read More

Worth Moving to Sweden as engineers?

December 17, 2018

TL;DR, Even though wages have risen a lot for engineers in fast growing economies like China or India. From my perspective as a Chinese who’s been working here for many years, Sweden might still be a very attractive place to work and settle depending on who you are, primarily for the following reasons:

Read More

Nioctib.tech, a Bitcoin Education Site

November 23, 2018

Recently I launched nioctib.tech, a Bitcoin education site which currently supports searching and displaying Bitcoin transactions as well as interpreting the locking and unlocking script associated with those transactions.

Read More

Blockchain with Scala

November 21, 2018

Yesterday I gave a talk in the Gothenburg Scala meetup titled Blockchain with Scala. A few things were covered in the presentation and I really enjoyed the discussion.

Read More

Thoughts on Ralph Merkle's "DAO Democracy"

November 1, 2018

The legendary scientist Ralph Merkle talked about his paper DAO democracy in a Epicenter podcast around 2 years ago, and the episode was re-posted this summer when all the Epicenter hosts were travelling at the same time. As the result, I listened to this episode three times and really enjoyed it.

Read More

信任的分层

April 8, 2018

区块链爱好者总爱提起:比特币在人类历史上第一次解决了去中心化的信任问题。这个提法既对,又不对。

Read More

The Tale of the flatMap

愿景和琐事的媒婆

December 9, 2017

当毛主席领导人民翻身闹革命时,起决定作用的农民兄弟对土地改革的兴趣远大于缥缈的意识形态。

Read More

Grand Vision and Mundane Tasks

December 8, 2017

When Mao lead the revolution, majority of the peasants who played the decisive role were more interested in land redistribution than communism.

Read More

比特币和宗教

December 2, 2017

中本聪: 因为消失,无可质询,似乎坐实了他不受挑战的教主地位。

Read More

Two Thoughts on Fintech and Blockchain

November 23, 2017

1) As much as people’s initial hope of how decentralized internet should be when it was first invented, we see very centralized services over the years for various reasons (convenience, efficiency, human nature, need for trust) at the same time when it flattens the world as humanity has never seen before.

Read More

A Bitcoin Library

October 7, 2017

One of the nice things about living in Sweden is the “pappaledighet” (parental leave). In the last two months I took that and had a lot of fun spending time with my lovely son Filip. But when he is asleep, I worked on a small Bitcoin library to help myself understand the intricacies of this amazing technology. After diving deeper into the blockchain space since March this year, I am gradually convinced of its potential to advance our societies because of one thing it enabled which was never possible before: dicentralised trust.

Read More

Clothes v.s. Politics

September 14, 2017

Political systems are like clothes. It is impossible to compare clothes without considering wearer’s personality, culture, education, taste, self-confidence, figure, mood, financial situations, identity as well as the current climate, occation, purpose, trend, etc. It would be ridiculous to ask everyone to wear the same cloth at the same time because there are just too many constantly changing variables.

Read More

Scala, the Startup Way

February 28, 2017

My colleague Marcus Lönnberg and myself gave a talk at the Scala Meetup today titled Scala, the startup way. We structured the talk with the idea from the exellent presentation On the spectrum of abstractions given by Cheng Lou a few months ago, to reason about making technical decisions such as asynchrous programming models, dependency injection, data types, CRUD vs Event sourcing, kubectl vs our in house testing environment tools, etc. It was an inspiring night with a lot of insightful discussions with all the Scalaentusiaster.

Read More

Some Thoughts after the Trump Victory

November 14, 2016

As many people out there, I have strong and bitter feelings towards Brexit and the Trump victory. I thought it represents a major setback from the globalisation which have brought so much cultual and economical prosperity into this world. It points to a gloomy future where people are futhur devided by their race, nationality, religious belief, sexuality, economic status… and there doesn’t seem to be any immediate solution for it.

Read More

A Game of Ping Pong with Akka

October 4, 2016

Being an Erlang developer for few years, Akka gives me very homey feelings. It takes direct inspiration from the Erlang/OTP and Riak Core, and grows into a great library for building concurrent, distrbuted and fault tolerant applications. On top of its core, modules such as Akka streams is developed to serve as a better abstraction for a class of problems over raw actors; Akka HTTP is written to help build Rest APIs, Akka Persistence is added to facilitate writing CQRS systems, among other things.

Read More

Scala Intro Talk

April 1, 2016

Yesterday I gave a talk at the Scala Meetup in Gothenburg. It was a lot of fun to discuss functional programming and object oriented programming with all the Scala geats and how Scala manage to support both programming paradigms but still manage to keep everything in a consistent way.

Read More

Functor

Method Injection in Scala

May 17, 2015

I remember the horror when I first came across implicit in scala, it sounded like a recipe for incomprehensible code. After a while I started to realize that there are a number of use cases where it could be very useful. An important example is method injection as it is discussed in the learning scalaz tutorial.

Read More

Chinese Version of Klarna?

November 11, 2014

About 3.5 years ago when I just started at Klarna, I was wondering if its business model could be replicated in China. The following is a little note that I had at the time about my naive perception of Chinese E-commerce in general and online payment in particular, and the reason why it might be hard.

Read More

Why Teespring Matters

November 10, 2014

E-commerce is taking over the world. There is no better evidence than the astonishing number put out by the e-commerce juggernaut Tmall today: In just about 38 minutes after it kicked start the double 11 shopping carnival, the Chinese equivalent of Black Friday, it has already handled its first 10 billion RMB (1.63 billion USD) worth of transactions, setting a new world record with huge margin.

Read More

Prepending Story id in Git Commit Messages

October 8, 2014

It is a good idea to prefix the git commit message with story id for better traceability. For the same reason, it is also nice to prefix the branch name with story id as well, even though git branch is more short lived than commit messages.

Read More

Virtualized Development Environment

September 26, 2014

Yesterday, a burglar sneaked into our office and stole one of my colleague’s Macbook while all of us were having a meeting in a conference room.

Read More

Typed Actors are Discouraged in Akka?

Little Fun with Emacs Start Buffer

Provision Docker using Ansible

September 10, 2014

I love Ansible and Docker, they are great two pieces of software that work pretty nicely together. While there is ansible module to manage docker containers, docker images themselves can be built using ansbile as well. We just need a base images that’s ansible enabled to start with:

Read More

Footprint on the Moon