How Do Smart Contracts Work in Blockchain?