Code for the embedded part of the BTC Idea