Based on bitcoin 0.6.3