Buffer reading and writing operations for Bitcoin apps