BitML: A Calculus for Bitcoin Smart Contracts