After ugly-hacking SX and bitcoinlib