Skip to content

Commit

Permalink
feat(docs): add new offchain-storage.mdx file to explain offchain sto…
Browse files Browse the repository at this point in the history
…rage in zkApps

feat(docs): update sidebars.js to include offchain-storage.mdx in the documentation navigation
  • Loading branch information
MartinMinkov committed May 15, 2024
1 parent a172cfc commit 066a079
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ This approach maintains a provably secure connection between the on-chain smart

Presently, Offchain storage offers support for two types of state: `OffchainState.Field`, representing a single field element, and `OffchainState.Map`, akin to the key-value maps found in JavaScript, like `let myMap = new Map<string, number>();`.

All offchain state resides within a single Merkle Map, which is essentially a wrapper around a [Merkle Tree](zkapps/o1js/merkle-tree.mdx). Practically speaking, there are no constraints on the number of state fields and maps that a developer can store in a smart contract using Offchain storage.
All offchain state resides within a single Merkle Map, which is essentially a wrapper around a [Merkle Tree](/zkapps/o1js/merkle-tree.mdx). Practically speaking, there are no constraints on the number of state fields and maps that a developer can store in a smart contract using Offchain storage.

Under this framework, [Actions and Reducer](zkapps/o1js/actions-and-reducer.mdx) are utilized to manage state changes, with actions dispatching state updates and reducers settling them. Additionally, a Merkle Tree is employed to maintain a provably secure commitment to the data, with the root stored on-chain.
Under this framework, [Actions and Reducer](/zkapps/writing-a-zkapp/feature-overview/actions-and-reducer.mdx) are utilized to manage state changes, with actions dispatching state updates and reducers settling them. Additionally, a Merkle Tree is employed to maintain a provably secure commitment to the data, with the root stored on-chain.

Prior to users accessing published state, it must first undergo settlement. Thanks to the design of Offchain storage, all state is recoverable from actions alone, eliminating the need for additional events or external data storage.

Expand Down
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ module.exports = {
items: [
'zkapps/writing-a-zkapp/feature-overview/smart-contracts',
'zkapps/writing-a-zkapp/feature-overview/on-chain-values',
'zkapps/writing-a-zkapp/feature-overview/offchain-storage',
'zkapps/writing-a-zkapp/feature-overview/permissions',
'zkapps/writing-a-zkapp/feature-overview/events',
'zkapps/writing-a-zkapp/feature-overview/actions-and-reducer',
Expand Down

0 comments on commit 066a079

Please sign in to comment.