> For the complete documentation index, see [llms.txt](https://base-tech.gitbook.io/base/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://base-tech.gitbook.io/base/base-bigbang-language/4.-storing-data.md).

# 4. Storing data

Smart contracts have a private storage space where different types of data members can be defined and used throughout the contract. These data members persist across transactions and can be changed by one transaction and read by another.

It is important to note that all data members must be defined on the top level of the contract and identified by a unique name. After the contract has been deployed, no new data members can be introduced. The storage system in BigBang consists of three types: constants, variables, and data maps.

Constant values are defined on the top level of the contract and cannot be changed. They are useful for defining the contract owner, error codes, and other static values. Variables, on the other hand, can be changed by future contract calls and have an initial value. Each variable contains exactly one value of a predefined type. Maps are collections of data identified by other data. They are used to relate one value to another, such as relating specific principals to unsigned integers to keep track of scores. Although data members are private, meaning only the current contract can use them, it does not mean that they are hidden. Data members should never be used to store sensitive information like passwords or private keys on the blockchain since anything on the blockchain is inherently public. The chain state allows for effortless extraction of any data member's value.


---

# 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://base-tech.gitbook.io/base/base-bigbang-language/4.-storing-data.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.
