I've recently started learning about smart contracts and came across this example.

Bob and Alice make a bet on the weather tomorrow. The smart contract gets the weather data the next day and automatically pays the winner.

My question is what if the loser's wallet is empty? How does the winner get their money?

1 Answer 1


As the example says, it uses a smart contract. The contract does not have access to the user wallets, and it never can have such access.

So what basically happens is that both parties send their bets to the contract in advance. The contract holds those assets until a winner has been decided. Then the winner can withdraw his/her wins from the contract.

Note that the example is not a very good example: getting external data (such as weather info) into blockchain is not trivial and it can go wrong easily.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.