Memory optimization of BTC signing and CBOR decoding.