A Theoretical Treatment Of Blockchain Scaling Protocols