> For the complete documentation index, see [llms.txt](https://www.digitalnations.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.digitalnations.xyz/web3-overview/the-web3-ecosystem/smart-contract-platforms/how-do-smart-contract-platforms-work/what-are-smart-contracts.md).

# What are Smart Contracts?

Smart contracts are nothing more than computer programs that automatically execute when agreed-upon conditions are met.  For example, let’s say that Farmer John wants to use a smart contract through Block Insurance (a fictitious entity) to insure his crops against a drought:&#x20;

1. Farmer John and Block Insurance agree that if the temperature is above 90 degrees for 5 days in a row, his crops will die
2. Farmer John sends Block Insurance 1 Ethereum (ETH) token to insure his crops
3. The 1 ETH is deposited into a smart contract
4. Block Insurance would deposit 10 ETH into the smart contract as collateral in case of a drought
5. The smart contract monitors the temperature
6. If the temperature remains under 90 degrees, nothing happens and Block Insurance keeps Farmer John’s 1 ETH
7. If the temperature goes over 90 degrees for 5 days in a row, the smart contract pays Farmer John 10 ETH
8. Farmer John can offset his crop loss with the profits from 10 ETH

Smart contracts can be used for virtually any type of transaction including financial deals, trade agreements, real estate transactions, entertainment royalties, etc…  They also have many benefits over traditional contracts including the fact that they are:&#x20;

* Instant:  Because smart contracts execute instantly, they can save hours of various business processes
* Accurate:  Using smart contracts reduces human error, such as mistakes that can be made when filling out multiple forms
* Cheap:  Smart contracts remove the needs for lawyers, bankers and brokers, making them much cheaper
* Transparent:  Terms and conditions are pre-agreed upon and fully visible to both parties.  As such there, is no way to dispute a smart contract after it has been executed
* Secure:  Information is stored on a decentralized and distributed blockchain, meaning that there is no risk of data loss


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.digitalnations.xyz/web3-overview/the-web3-ecosystem/smart-contract-platforms/how-do-smart-contract-platforms-work/what-are-smart-contracts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
