Using blockchain for smart contracts