smart contracts for blockchain mining