-Created with the zkApp CLI, a [deploy alias](/zkapps/tutorials/deploying-to-a-network#deploy-alias) in your project `config.json` file contains the details to manage deployments.
+**Block 1**: A block producer includes four transactions into the scan state labeled `B1`. These transactions fill the base of the first tree.
-### Devnet
+
-Dedicated for developers building on top of the Mina protocol, Devnet is designed for testing and experimentation so you can test tooling and integrations before going live on [Mainnet](#mainnet). See [Connect to Mainnet or Devnet](/node-operators/validator-node/connecting-to-the-network).
+**Block 2**: At the second block, a block producer adds another four transactions (`B2`). These are added to a second tree, once again filling the base. There are no proofs required due to the work delay of 1 block.
-### distributed ledger technology (DLT)
+
-A digital system for recording the transaction of assets in which the transactions and their details are recorded in multiple places at the same time. In contrast to traditional databases, distributed ledgers have no central data store or administration functionality.
+**Block 3**: At the third block, a block producer adds four `B3` transactions to the third tree but must include four proofs for the first tree. As a result of including these completed base proofs, two new `M3` merge jobs are created.
-## E
+
-## ECDSA
+:::tip
-Elliptic Curve Digital Signature Algorithm ([ECDSA](/zkapps/o1js/ecdsa)) a cryptographic algorithm used to sign and verify messages. It is used in many blockchains, including Ethereum, to sign transactions.
+`B` or `M` indicates a base or merge job, with the number indicating the sequence order of being added to the scan state.
-## elliptic curves
+:::
-Equations with a specific template, including: _y^2 = x^3 + ax^ + b_: [secp256k1](/glossary#secp256k1).
+**Block 4**: For the fourth block, a block producer adds another four transactions (`B4`) to the base of the fourth tree. They must include four proofs corresponding to the work added in block 2. Again, two `M4` merge jobs are created as a result.
-### elliptic-curve cryptography (ECC)
+
-An approach to public key cryptography based on the algebraic structure of elliptic curves over finite fields. ECC is the basis of how Ethereum and other cryptocurrencies use private keys and digital signatures.
+:::tip
-### epoch
+Any pending work (displayed in orange) is work for the SNARK workers to complete. The SNARK workers submit completed work to the SNARK pool. Multiple SNARK workers can complete the work, but only the lowest fee remains in the SNARK pool that can be purchased by the block producers.
-A unit of time equal to 7140 slots at Mainnet. An epoch is divided into [slots](#slot) of 3 minutes each.
+:::
-### extensional blocks
+**Block 5**: In the fifth block, another four transactions are included to fill the base of tree five (`B5`), and six proofs must be included (`B3`s and `M3`s). The `M3` merge jobs result in a final pending merge job for the first tree (`M5`).
-Blocks extracted from the `mina-archive` database contain only the information required to restore data to the archive node and are more lightweight than [precomputed blocks](/glossary#precomputed-blocks).
+
-### external port
+**Block 6**: In the sixth block, another four transactions (`B6`) are added, filling the base of the sixth tree. Six proofs are included (`B4` and `M4`), and three new merge jobs are created (`M6`).
-The port that the Mina daemon uses to connect to other nodes on the network. When starting the daemon, set using `-external-port`.
+
-### external transition
+**Block 7**: In the seventh block, the block producer adds a further four transactions (`B7`), filling the base of the seventh tree. Seven trees are the maximum number of trees according to the specified scan state constants. The maximum number of proofs (7) are included (`B5` and `M5`). These included proofs create three new merge jobs (`M7`);additionally, the top `M5` proof is emitted from the scan state.
-Also referred to as a [block](#block), an external transition is generated externally, for example, by another block producer, and gossiped to a node.
+
-## F
+The proof that is emitted from the first tree is the ledger proof corresponding to the transactions added in block 1. The contents of the tree are then removed to create space for additional transactions.
-## fee payer account
+
-A developer account that is funded and can always pay fees immediately. When you configure a zkApp, you can choose to use a stored account or create a new fee payer account.
+**Block 8**: In the eighth block, the block producer adds two transactions (`B8`) and includes 4 (`B6`) proofs. These included proofs result in two new merge jobs (`M8`). Note that only four proofs are required for adding two transactions.
-### field element
+
-The basic unit of data in zero knowledge proof programming. Each field element can store a number up to almost 256 bits in size. You can think of a field element as a uint256 in Solidity. For the cryptography inclined, the exact max value that a field can store is 28,948,022,309,329,048,855,892,746,252,171,976,963,363,056,481,941,560,715,954,676,764,349,967,630,336.
+:::tip
-### finality
+SNARK work is bundled into a work package typically containing two _workIds_, except for the final root proof of a tree. Prorated work for a transaction is two proofs, ensuring the equality of transactions included and SNARK work to be purchased.
-A consensus constant `k` is the point at which chain [reorganizations](#reorganization) are no longer possible. After a block has `k` [block confirmations](#block-confirmations) as defined by the consensus constants, it is considered final.
+:::
-## foreign field
+**Block 9**: The block producer adds three transactions (`B9`) in the ninth block. Three proofs (`M6`) are required to occupy the slots in the currently unfilled tree. Four proofs were added in the previous block, so only three more proofs need to be done (given the maximum work is 7). The `M6` proof from tree two is returned as the ledger proof. The third `B9` transaction goes into the now empty tree, and two `B7` proofs are added.
-A finite field different from the native field of the proof system. [Foreign Field Arithmetic](/zkapps/o1js/ecdsa) lets you perform algorithms that connect your zkApp with the outside world of cryptography.
+
-### full node
+**Block 10**: In block ten, the block producer adds four transactions and, as a result, includes seven proofs (`B7`, `M7`, and two `B8`s).
-A Mina node that is able to verify the state of the network trustlessly. In Mina, every node is a full node since all nodes can receive and verify zk-SNARKs.
+
-# G
+**Block 11**: In the eleventh block, the block producer adds three transactions (`B11`) and completes five proofs (`B9`, `B9`, `M8`, `M8`, `M9`) in that order. In addition, the `M9` ledger proof is returned from the fourth tree.
-## gadgets
+
-Small, reusable, low-level building blocks that simplify the process of creating new cryptographic primitives. Most [gadgets](/zkapps/o1js/gadgets) build upon custom gates and act as low-level accelerators in the proof system.
+:::tip
-## H
+To view the contents of the scan state, run the `mina advanced snark-job-list` command.
-### hash
+:::
-A mathematical cryptographic function that converts an input of arbitrary length into an encrypted output of a fixed length. Hashing provides security through encryption and is an efficient store of data because the hash is of a fixed size.
+### Integration with the SNARK Pool
-### hot wallet
+Newly added jobs to the scan state are pending jobs for SNARK workers to complete. SNARK workers complete the required transaction SNARKs, submitting bids for their completed work. When a node receives and validates the completed work, SNARK workers add the completed work to the local SNARK pool if it is valid and has the lowest fee for the required work. The work is also gossiped to other peers in the network.
-A wallet is "hot" if the private key is available on a machine that is connected to the internet. To mitigate risk in the case of hackers breaking into their systems, careful block producers avoid having hot wallets with substantial stake on them.
+:::tip
-## I
+While multiple SNARK workers can complete the same work, only the lowest fee is included in the SNARK pool.
-### internal transition
+:::
-A [transition](#transition) that is produced locally, for example, by a block producer. The generated transition is applied locally and added to the [transition frontier](#transition-frontier) before being broadcast to peers.
+When a block producer includes completed proofs into a block to offset any transactions they add, they may purchase the corresponding work from the SNARK pool. Continuing the previous example, consider the next block (12). If the block producer wants to add three transactions, comprising a coinbase, a user payment, and a fee transfer to the SNARK worker, the block producer must purchase three completed SNARK works. This corresponds to the six `B9`, `B10`s, `M9`, and `M10` (from the seventh tree) proofs, as each SNARK work includes two _workIds_.
-## K
+During the time the block is generated, the SNARK pool can include completed work and the best bids for the required jobs (0.025, 0.165, 0.1, and 0.5) respectively, in the example.
-## Keccak
+
-[Keccak (SHA-3)](/zkapps/o1js/keccak) is a flexible cryptographic hash function that provides more security than traditional SHA hash algorithms.
+A block producer considers the price of available work before selecting transactions.
-### key pair
+- The first transaction a block producer adds is the coinbase transaction for which there is the coinbase reward.
+- If transaction fees do not cover the SNARK work fees required for them to be included, the transaction is not added.
-A combination of a [private key](#private-key) and [public key](#public-key). Key pairs can be generated by using a running daemon or using a dedicated keygen tool, see [Generating a Key Pair](/node-operators/validator-node/generating-a-keypair). In Mina, public keys start with `B62` and private keys start with `EK` for easy differentiability.
+A block producer never purchases work if it is not economical.
-### Kimchi
+If completed SNARK work is not available to purchase in the order required, then the corresponding transactions are not included in a block. This situation can result in an empty block, but also, for the case where no transactions can be added (including a coinbase transaction), there is no reward for the block producer.
-The proof system for Mina, Kimchi is the main machinery that generates the recursive proofs that keep the Mina blockchain small (about 22 KB). Kimchi is a zero knowledge proof system that's a variant of [PLONK](/glossary#plonk) and features a polynomial commitment scheme that supports verifiable computation using traditional Turing machine-based instruction sets.
+To view the current SNARK pool, use:
-## L
+- [GraphQL API](/node-developers/graphql-api)
+- Mina CLI `mina advanced snark-pool` command
-### layer 1 (L1)
+---
+url: /mina-protocol/sending-a-payment
+---
-The fundamental, base-level chain in a network. An L1 blockchain provides the essential services to a network, like recording transactions on the public ledger and ensuring adequate security. Mina is a layer 1 blockchain.
+# Sending a Payment
-### layer 2 (L2)
-An off-chain network, system, or technology built on top of a layer 1 blockchain that helps extend the capabilities of the underlying base layer network.
-### ledger
+
+
+Mina Signer can accept a generic payload and determine the most apt signing approach via `signTransaction()`.
+This functionality is especially beneficial for applications that support different types of transactions.
-**Block 1**: A block producer includes four transactions into the scan state labeled `B1`. These transactions fill the base of the first tree.
+```js
-
+const client = new Client({ network: 'mainnet' });
+const keypair = client.genKeys();
-**Block 2**: At the second block, a block producer adds another four transactions (`B2`). These are added to a second tree, once again filling the base. There are no proofs required due to the work delay of 1 block.
+// Sign a payment
+client.signTransaction(
+ {
+ to: keypair.publicKey,
+ from: keypair.publicKey,
+ amount: '1',
+ fee: '1',
+ nonce: '0',
+ },
+ keypair.privateKey
+);
-
+// Sign a delegation
+client.signTransaction(
+ {
+ to: keypair.publicKey,
+ from: keypair.publicKey,
+ fee: '1',
+ nonce: '0',
+ },
+ keypair.privateKey
+);
-**Block 3**: At the third block, a block producer adds four `B3` transactions to the third tree but must include four proofs for the first tree. As a result of including these completed base proofs, two new `M3` merge jobs are created.
-
+// Sign a zkApp transaction
+client.signTransaction(
+ {
+ zkappCommand: ...,
+ feePayer: ...
+ },
+ keypair.privateKey
+);
-:::tip
+// Sign a simple string payload
+client.signTransaction('Hello World', keypair.privateKey);
+```
-`B` or `M` indicates a base or merge job, with the number indicating the sequence order of being added to the scan state.
+### Broadcasting a Signed Payment
-:::
+After signing a payment, you can broadcast it to the network via a Mina Node GraphQL endpoint:
-**Block 4**: For the fourth block, a block producer adds another four transactions (`B4`) to the base of the fourth tree. They must include four proofs corresponding to the work added in block 2. Again, two `M4` merge jobs are created as a result.
+```javascript
-
-:::tip
+const client = new Client({ network: 'mainnet' });
-Any pending work (displayed in orange) is work for the SNARK workers to complete. The SNARK workers submit completed work to the SNARK pool. Multiple SNARK workers can complete the work, but only the lowest fee remains in the SNARK pool that can be purchased by the block producers.
+const senderPrivateKey = 'EKFd1Gx...';
+const senderPublicKey = 'B62qrDM...';
-:::
+let payment = {
+ from: senderPublicKey,
+ to: 'B62qkBw...',
+ amount: 100,
+ nonce: 1,
+ fee: 1000000,
+};
-**Block 5**: In the fifth block, another four transactions are included to fill the base of tree five (`B5`), and six proofs must be included (`B3`s and `M3`s). The `M3` merge jobs result in a final pending merge job for the first tree (`M5`).
+const signedPayment = client.signPayment(payment, senderPrivateKey);
-
+const url = 'https://your-mina-node/graphql';
-**Block 6**: In the sixth block, another four transactions (`B6`) are added, filling the base of the sixth tree. Six proofs are included (`B4` and `M4`), and three new merge jobs are created (`M6`).
+const sendPaymentMutationQuery = `
+mutation SendPayment($input: SendPaymentInput!, $signature: SignatureInput!) {
+ sendPayment(input: $input, signature: $signature) {
+ payment {
+ hash
+ }
+ }
+}
+`;
+const graphQlVariables = {
+ input: signedPayment.data,
+ signature: signedPayment.signature,
+};
+const body = JSON.stringify({
+ query: sendPaymentMutationQuery,
+ variables: graphQlVariables,
+ operationName: 'SendPayment',
+});
-
+const paymentResponse = await fetch(url, {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body,
+});
-**Block 7**: In the seventh block, the block producer adds a further four transactions (`B7`), filling the base of the seventh tree. Seven trees are the maximum number of trees according to the specified scan state constants. The maximum number of proofs (7) are included (`B5` and `M5`). These included proofs create three new merge jobs (`M7`);additionally, the top `M5` proof is emitted from the scan state.
+const paymentResponseJson = await paymentResponse.json();
+if (paymentResponse.ok) {
+ console.log(
+ `Transaction hash: ${paymentResponseJson.data.sendPayment.payment.hash}`
+ );
+} else {
+ console.error(JSON.stringify(paymentResponseJson));
+}
+```
-
+### Payment & Delegation Transaction Hashes
-The proof that is emitted from the first tree is the ledger proof corresponding to the transactions added in block 1. The contents of the tree are then removed to create space for additional transactions.
+In addition to signing/verifying payments/delegations for the Mina Protocol, Mina Signer allows you to compute the hash that will be used to identify the transaction on the blockchain. This is useful for applications that require the transaction hash before the transaction is broadcasted to the network.
-
+```js
-**Block 8**: In the eighth block, the block producer adds two transactions (`B8`) and includes 4 (`B6`) proofs. These included proofs result in two new merge jobs (`M8`). Note that only four proofs are required for adding two transactions.
+const client = new Client({ network: 'mainnet' });
+const keypair = client.genKeys();
-
-
-:::tip
-
-SNARK work is bundled into a work package typically containing two _workIds_, except for the final root proof of a tree. Prorated work for a transaction is two proofs, ensuring the equality of transactions included and SNARK work to be purchased.
-
-:::
-
-**Block 9**: The block producer adds three transactions (`B9`) in the ninth block. Three proofs (`M6`) are required to occupy the slots in the currently unfilled tree. Four proofs were added in the previous block, so only three more proofs need to be done (given the maximum work is 7). The `M6` proof from tree two is returned as the ledger proof. The third `B9` transaction goes into the now empty tree, and two `B7` proofs are added.
-
-
-
-**Block 10**: In block ten, the block producer adds four transactions and, as a result, includes seven proofs (`B7`, `M7`, and two `B8`s).
-
-
+const payment = client.signTransaction(
+ {
+ to: keypair.publicKey,
+ from: keypair.publicKey,
+ amount: '1',
+ fee: '1',
+ nonce: '0',
+ },
+ keypair.privateKey
+);
+const hashedPayment = client.hashPayment(payment);
-**Block 11**: In the eleventh block, the block producer adds three transactions (`B11`) and completes five proofs (`B9`, `B9`, `M8`, `M8`, `M9`) in that order. In addition, the `M9` ledger proof is returned from the fourth tree.
+const delegation = client.signTransaction(
+ {
+ to: keypair.publicKey,
+ from: keypair.publicKey,
+ fee: '1',
+ nonce: '0',
+ },
+ keypair.privateKey
+);
+const hashedDelegation = client.hashStakeDelegation(delegation);
+```
-
+### Rosetta Integration
-:::tip
+For those developing with [Rosetta](https://www.rosetta-api.org/), Mina Signer provides an avenue to transform a signed Rosetta transaction into a Mina-compliant transaction, ready for broadcasting through the Mina Daemon.
-To view the contents of the scan state, run the `mina advanced snark-job-list` command.
+```js
-:::
+const client = new Client({ network: 'mainnet' });
-### Integration with the SNARK Pool
+const signedRosettaTx = '...';
+const signedGraphQLCommand =
+ client.signedRosettaTransactionToSignedCommand(signedRosettaTx);
+```
-Newly added jobs to the scan state are pending jobs for SNARK workers to complete. SNARK workers complete the required transaction SNARKs, submitting bids for their completed work. When a node receives and validates the completed work, SNARK workers add the completed work to the local SNARK pool if it is valid and has the lowest fee for the required work. The work is also gossiped to other peers in the network.
+For detailed Rosetta usage including the offline signer CLI tool and `signRosettaTransaction`, see the [Mina Signer for Node Operators](/node-operators/mina-signer) documentation.
-:::tip
+## o1js Integration
-While multiple SNARK workers can complete the same work, only the lowest fee is included in the SNARK pool.
+Mina Signer can seamlessly integrate with [o1js](/zkapps/o1js), delivering an array of features for zkApps like:
-:::
+- zkApp transaction signing and verification
+- Field payload signing and verification
+- Nullifier generation
-When a block producer includes completed proofs into a block to offset any transactions they add, they may purchase the corresponding work from the SNARK pool. Continuing the previous example, consider the next block (12). If the block producer wants to add three transactions, comprising a coinbase, a user payment, and a fee transfer to the SNARK worker, the block producer must purchase three completed SNARK works. This corresponds to the six `B9`, `B10`s, `M9`, and `M10` (from the seventh tree) proofs, as each SNARK work includes two _workIds_.
+### Signing & Verifying zkApp transactions
-During the time the block is generated, the SNARK pool can include completed work and the best bids for the required jobs (0.025, 0.165, 0.1, and 0.5) respectively, in the example.
+Mina Signer supports signing and verifying zkApp transactions. o1js itself can be used to sign zkApp transactions,
+but Mina Signer offers the ability to sign a zkApp transaction that can easily be broadcasted with a Mina Daemon. This can be very useful for wallet applications that want to support zkApps.
-
+```js
-A block producer considers the price of available work before selecting transactions.
-- The first transaction a block producer adds is the coinbase transaction for which there is the coinbase reward.
-- If transaction fees do not cover the SNARK work fees required for them to be included, the transaction is not added.
-A block producer never purchases work if it is not economical.
+const client = new Client({ network: 'testnet' });
+const keypair = client.genKeys();
-If completed SNARK work is not available to purchase in the order required, then the corresponding transactions are not included in a block. This situation can result in an empty block, but also, for the case where no transactions can be added (including a coinbase transaction), there is no reward for the block producer.
+const zkAppTransaction = await Mina.transaction(feePayerAddress, () => {
+ // ... Interact with a zkApp inside this block to produce a zkApp transaction
+});
-To view the current SNARK pool, use:
+// Sign the zkApp transaction with Mina Signer
+const signedZkAppTransaction = client.signZkappCommand(
+ {
+ zkappCommand: JSON.parse(JSON.stringify(txn.transaction)),
+ feePayer: {
+ feePayer: keypair.publicKey,
+ fee: '1',
+ nonce: '0',
+ memo: 'memo',
+ },
+ },
+ keypair.privateKey
+);
-- [GraphQL API](/node-developers/graphql-api)
-- Mina CLI `mina advanced snark-pool` command
+// Verify the zkApp transaction with Mina Signer
+const verifiedZkAppTransaction = client.verifyZkappCommand(
+ signedZkAppTransaction
+);
+```
----
-url: /mina-protocol/sending-a-payment
----
+Firstly, when supplying the input parameters for `signZkappCommand()`, we must first parse the zkApp transaction into a string and then into a JSON object. This is because the types generated from `Mina.transaction()` are not compatible with the types used by Mina Signer.
+Secondly, we specify the `feePayer` object which contains the public key of the fee payer, the fee to be paid, the nonce of the fee payer, and the memo of the transaction. The `feePayer` object is used to sign the zkApp transaction.
-# Sending a Payment
+:::tip
+Use o1js to sign zkApp transactions if you can, as it's more ergonomic and easier to use. Only use `Mina Signer` if you need to sign zkApp transactions offline and broadcast at a later time (e.g. wallet software).
+:::
+### Signing/Verifying Field payloads
+Mina Signer can sign and validate Field payloads. This is invaluable when ensuring a Field payload's authenticity, as it confirms the payload remains untampered by external parties.
-
-
-- [Understand the Archive Migration](/network-upgrades/berkeley/archive-migration/understanding-archive-migration)
-- Meet the foundational requirements in [Archive migration prerequisites](/network-upgrades/berkeley/archive-migration/archive-migration-prerequisites)
-- Have successfully installed the [archive migration package](/network-upgrades/berkeley/archive-migration/archive-migration-installation)
+Below it's the description in detail of all the upgrade steps and what which node operator type should do to in each step.
-## Migration process
+## Pre-Upgrade
-The Devnet/Mainnet migration can take up to a couple of days.
-Therefore, you can achieve a successful migration by using three stages:
+- During the Pre-Upgrade phase, node operators should prepare for the upcoming upgrade. The most important steps are:
+ - Review the [upgrade readiness checklist](https://docs.google.com/document/d/1rTmJvyaK33dWjJXMOSiUIGgf8z7turxolGHUpVHNxEU/edit#heading=h.2hqz0ixwjk3f) to confirm they have covered the required steps.
+ - Upgrade their nodes to the 1.4.1 stable version
+ - Ensure servers are provisioned to run Berkeley nodes, meeting the new hardware requirements
+ - Upgrade their nodes to the node version [3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3), with stop-slots, when this version becomes available
+ - Start the archive node initial migration if they run archive nodes and wish to perform the migration in a decentralized manner
-- **Stage 1:** Initial migration
+**Please note:** a simplified Node Status service will be part of the upgrade tooling and enabled by default in Pre-Upgrade release with the stop-slots ([3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3)). This feature will allow for a safe upgrade by monitoring the amount of upgraded active stake. Only non-sensitive data will be reported. If operators are not comfortable sharing their node version, they will have the option to disable the node version reports by using the appropriate node flag `--node-stats-type none`
-- **Stage 2:** Incremental migration
+### Block Producers and SNARK Workers
+1. Review the [upgrade readiness checklist](https://docs.google.com/document/d/1rTmJvyaK33dWjJXMOSiUIGgf8z7turxolGHUpVHNxEU).
+1. Provision servers that meet the minimum hardware requirements, including the new 32GB RAM requirement and support for _AVX_ and _BMI2_ CPU instructions.
+1. Upgrade nodes to node version [3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3) ([3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3) has built-in stop slots).
-- **Stage 3:** Remainder migration
+### Archive Node Operators and Rosetta Operators
+- Two migration processes will be available to archive node operators: _trustless_ and _trustful_. If the archive node operator wants to perform the _trustless_ migration, they should follow these steps; otherwise, proceed to the Upgrade phase. The _trustful_ migration will rely on o1Labs database exports and Docker images to migrate the archive node database and doesn’t require any actions at this stage.
-Each stage has three migration phases:
+1. Trustless migration:
+ - Perform the initial archive node migration. Since Mainnet is a long-lived network, the initial migration process can take up to 48 hours, depending on your server specification and infrastructure.
+ - If your Mina Daemon, archive node, or PostgreSQL database runs on different machines, the migration performance will be greatly impacted.
+ - For more information on the archive node migration process, please refer to the [Archive Migration](/network-upgrades/berkeley/archive-migration) section.
+2. Upgrade all nodes to the latest stable version [3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3).
+3. Provision servers that meet the minimum hardware requirements, primarily the new 32GB RAM requirement.
+4. Upgrade their nodes to the version that includes built-in stop slots before the pre-defined _stop-transaction-slot_.
-- **Phase 1:** Copying data and precomputed blocks from Devnet/Mainnet database using the **berkeley_migration** app.
+### Exchanges
+1. Make sure to test your system integration with Berkeley's new features. Pay special attention to:
+ - If you use the **o1labs/client-sdk** library to sign transactions, you should switch to **[mina-signer](https://www.npmjs.com/package/mina-signer)**. o1labs/client-sdk was **deprecated** some time ago and will be **unusable** once the network has been upgraded. Please review the migration instructions in [Appendix](/network-upgrades/berkeley/appendix).
+ - If you rely on the archive node SQL database tables, please review the schema changes in Appendix 1 of this document.
+2. Upgrade all nodes to the latest stable version [3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3).
+3. Provision servers that meet the minimum hardware requirements, particularly the new 32GB RAM requirement.
+4. Upgrade your nodes to the version that includes built-in stop slots before the pre-defined _stop-transaction-slot_.
-- **Phase 2:** Populating new Berkeley tables using the **replayer app in migration mode**
+***
-- **Phase 3:** Additional validation for migrated database
+## State Finalization
+- Between the predefined _stop-transaction-slot_ and _stop-network-slot_, a stabilization period of 100 slots will occur. During this phase, the network consensus will not accept new blocks with transactions on them, including coinbase transactions. The state finalization period ensures all nodes reach a consensus on the latest network state before the upgrade.
+- During the state finalization slots, it is crucial to maintain a high block density. Therefore, block producers and SNARK workers shall continue running their nodes to support the network's stability and security.
+- Archive nodes should also continue to execute to ensure finalized blocks are in the database and can be migrated, preserving the integrity and accessibility of the network's history.
-Review these phases and stages before you start the migration.
+### Block Producers and SNARK Workers
+1. It is crucial for the network's successful upgrade that all block producers and SNARK workers maintain their block-producing nodes up and running throughout the state finalization phase.
+2. If you are running multiple daemons like is common with many operators, you can run one single node at this stage.
+3. If you are a Delegation Program operator, remember that your uptime data will continue to be tracked during the state finalization phase and will be considered for the delegation grant in the following epoch.
-## Simplified approach
+### Archive Node Operators and Rosetta Operators
+**If you plan to do the _trustful_ migration, you can skip this step.**
+If you are doing the trustless migration, then:
+1. Continue to execute the archive node to ensure finalized blocks are in the database and can be migrated.
+2. Continue to run incremental archive node migrations until after the network stops at the stop-network slot.
+3. For more information on the archive node migration process, please refer to the [Archive Migration](/network-upgrades/berkeley/archive-migration) section
-For convenience, use the `mina-berkeley-migration-script` app if you do not need to delve into the details of migration or if your environment does not require a special approach to migration.
+### Exchanges
-### Stage 1: Initial migration
+Exchanges shall disable MINA deposits and withdrawals during the state finalization period (the period between _stop-transaction-slot_ and _stop-network-slot_) since any transactions after the _stop-transaction-slot_ will not be part of the upgraded chain.
-```
-mina-berkeley-migration-script \
- initial \
- --genesis-ledger ledger.json \
- --source-db postgres://postgres:postgres@localhost:5432/source \
- --target-db postgres://postgres:postgres@localhost:5432/migrated \
- --blocks-bucket mina_network_block_data \
- --blocks-batch-size 500 \
- --checkpoint-interval 10000 \
- --checkpoint-output-path . \
- --precomputed-blocks-local-path . \
- --network NETWORK
-```
+Remember that although you might be able to submit transactions, the majority of the block producers will be running a node that discards any blocks with transactions.
-where:
+***
-`-g | --genesis-ledger`: path to the genesis ledger file
+## Upgrade
-`-s | --source-db`: connection string to the database to be migrated
+- Starting at the _stop-network-slot_ the network will not produce nor accept new blocks, resulting in halting the network. During the upgrade period, o1Labs will use automated tooling to export the network state based on the block at the slot just before the _stop-transaction-slot_. The exported state will then be baked into the new Berkeley build, which will be used to initiate the upgraded network. It is during the upgrade windows that the Berkeley network infrastructure will be bootstrapped, and seed nodes will become available. o1Labs will also finalize the archive node migration and publish the PostgreSQL database dumps for import by the archive node operators who wish to bootstrap their archives in a trustful manner.
+- There is a tool available to validate that the Berkeley node was built from the pre-upgrade network state. To validate, follow the instructions provided in this [location](https://github.com/MinaProtocol/mina/blob/berkeley/docs/upgrading-to-berkeley.md)
-`-t | --target-db`: connection string to the database that will hold the migrated data
+### Block Producers and SNARK Workers
+1. During the upgrade phase (between _stop-network-slot_ and the publishing of the Berkeley release), block producers can shut down their nodes.
+2. After the publication of the Berkeley node release, block producers and SNARK workers should upgrade their nodes and be prepared for block production at the genesis timestamp, which is the slot when the first Berkeley block will be produced.
+3. It is possible to continue using the same libp2p key after the upgrade. Remember to adjust the new flag to pass the libp2p key to the node.
-`-b | --blocks-bucket`: name of the precomputed blocks bucket. Precomputed blocks are assumed to be named with format: `{network}-{height}-{state_hash}.json`
+### Archive Node Operators and Rosetta Operators
+1. Upon publishing the archive node Berkeley release, archive node operators and Rosetta operators should upgrade their systems.
+There will be both Docker images and archive node releases available to choose from.
+2. Depending on the chosen migration method:
+ - _Trustless_
+ - Operators should direct their Berkeley archive process to the previously migrated database.
+ - _Trustful_
+ - Operators shall import the SQL dump file provided by o1Labs to a freshly created database.
+ - Operators should direct their Berkeley archive process to the newly created database.
-`-bs | --blocks-batch-size`: number of precomputed blocks to be fetched at one time from Google Cloud. A larger number, like 1000, can help speed up the migration process.
+**Please note:** both the _trustless_ and _trustful_ migration processes will discard all Mainnet blocks that are not canonical. If you wish to preserve the entire block history, i.e. including non-canonical blocks, you should maintain the Mainnet archive node database for posterior querying needs.
-`-n | --network`: network name (`devnet` or `mainnet`) when determining precomputed blocks. Precomputed blocks are assumed to be named with format: `{network}-{height}-{state_hash}.json`.
+### Exchanges
+1. Exchanges shall disable MINA deposits and withdrawals during the entirety of the upgrade downtime, since the _stop-transaction-slot_ until the Mainnet Berkeley network is operational.
+2. After the Berkeley releases are published, exchanges should upgrade their nodes and prepare for the new network to start block production.
-`-c | --checkpoint-output-path`: path to folder for replayer checkpoint files
+***
-`-i | --checkpoint-interval`: frequency of dumping checkpoint expressed in blocks count
+## Post-Upgrade
+- At approximately 1 hour after the publishing of the Berkeley node release, at a predefined slot (Berkeley genesis timestamp), block production will start, and the network is successfully upgraded.
+- Node operators can monitor their nodes and provide feedback to the technical team in case of any issues. Builders can start deploying zkApps.
+- **Please note:** The Node Status service will not be enabled by default in the Berkeley release. If you wish to provide Node Status and Error metrics and reports to Mina Foundation, helping monitor the network in the initial phase, please use the following flags when running your nodes:
+ - `--node-stats-type [full|simple]`
+ - `--node-status-url https://nodestats.minaprotocol.com/submit/stats`
+ - `--node-error-url https://nodestats.minaprotocol.com/submit/stats`
+ - The error collection service tries to report any node crashes before the node process is terminated
-`-l | --precomputed-blocks-local-path`: path to folder for on-disk precomputed blocks location
+### Block Producers and SNARK Workers
+1. Ensure that all systems have been upgraded and prepared for the start of block production.
+2. Monitor nodes and network health, and provide feedback to the engineering team in case of any issues.
-The command output is the `migration-replayer-XXX.json` file required for the next run.
+### Archive Node Operators and Rosetta Operators
+1. Ensure that all systems have been upgraded and prepared for the start of block production.
+2. Monitor nodes and network health, and provide feedback to the engineering team in case of any issues.
-### Stage 2: Incremental migration
+### Exchange and Builders
+1. After the predefined Berkeley genesis timestamp, block production will commence, and MINA deposits and withdrawals can be resumed.
+2. Ensure that all systems have been upgraded and prepared for the start of block production.
+3. Monitor nodes and network health, and provide feedback to the engineering team in case of any issues.
-```
-mina-berkeley-migration-script \
- incremental \
- --genesis-ledger ledger.json \
- --source-db postgres://postgres:postgres@localhost:5432/source \
- --target-db postgres://postgres:postgres@localhost:5432/migrated \
- --blocks-bucket mina_network_block_data \
- --blocks-batch-size 500 \
- --network NETWORK \
- --checkpoint-output-path . \
- --checkpoint-interval 10000 \
- --precomputed-blocks-local-path . \
- --replayer-checkpoint migration-checkpoint-XXX.json
-```
+---
+url: /network-upgrades
+---
-where:
+# Network Upgrades
-`-g | --genesis-ledger`: path to the genesis ledger file
+Mina protocol evolves through network upgrades (hard forks) that introduce new features and improvements. Each upgrade requires node operators to update their software to remain compatible with the network.
-`-s | --source-db`: connection string to the database to be migrated
+:::tip Mesa preflight hard fork completed
-`-t | --target-db`: connection string to the database that will hold the migrated data
+The Mesa preflight network hard-forked at **2026-04-27 13:00 UTC**. The post-fork chain is now running the Mesa release **`4.0.0-preflight-3f038cb`**, which raises the **transaction protocol version to 5.0.0**.
-`-b | --blocks-bucket`: name of the precomputed blocks bucket. Precomputed blocks are assumed to be named with format: `{network}-{height}-{state_hash}.json`
+Operators must run **`4.0.0-preflight-3f038cb`** to remain on the preflight network. Earlier builds — including the stop-slot release `4.0.0-preflight-stop-2967b39` — are no longer compatible with the post-fork chain.
-`-bs | --blocks-batch-size`: number of precomputed blocks to be fetched at one time from Google Cloud. A larger number, like 1000, can help speed up migration process.
+zkApp developers must update to **`o1js@3.0.0-mesa.698ca`**, which targets transaction protocol v5.0.0; earlier o1js releases will produce transactions that the post-fork network rejects.
-`-n | --network`: network name (`devnet` or `mainnet`) when determining precomputed blocks. Precomputed blocks are assumed to be named with format: `{network}-{height}-{state_hash}.json`.
+See [Preflight Network](/network-upgrades/mesa/preflight-network) for the full upgrade path.
-`-r | --replayer-checkpoint`: path to the latest checkpoint file `migration-checkpoint-XXX.json`
+:::
-`-c | --checkpoint-output-path`: path to folder for replayer checkpoint files
+| Upgrade | Status | Date | Key Changes |
+|---------|--------|------|-------------|
+| [Berkeley](/network-upgrades/berkeley/requirements) | Completed | June 2024 | zkApp programmability, recursive proofs, new transaction model, archive database migration |
+| [Mesa](/network-upgrades/mesa/preflight-network) | Preflight hard fork completed | 2026-04-27 13:00 UTC (preflight) | Transaction protocol v5.0.0, automode upgrades, simplified archive migration |
-`-i | --checkpoint-interval`: frequency of dumping checkpoint expressed in blocks count
+---
+url: /network-upgrades/mesa/archive-upgrade
+---
-`-l | --precomputed-blocks-local-path`: path to folder for on-disk precomputed blocks location
+# Archive Upgrade
-### Stage 3: Remainder migration
+This guide describes the general procedure for upgrading a Mina archive database from Berkeley to Mesa. The same steps apply to every Mesa deployment (preflight, devnet, mainnet) — only the archive package version differs.
-```
-mina-berkeley-migration-script \
- final \
- --genesis-ledger ledger.json \
- --source-db postgres://postgres:postgres@localhost:5432/source \
- --target-db postgres://postgres:postgres@localhost:5432/migrated \
- --blocks-bucket mina_network_block_data \
- --blocks-batch-size 500 \
- --network NETWORK \
- --checkpoint-output-path . \
- --checkpoint-interval 10000 \
- --precomputed-blocks-local-path . \
- --replayer-checkpoint migration-checkpoint-XXX.json \
- -fc fork-genesis-config.json
-```
+:::tip Mesa preflight hard fork completed
-where:
+The Mesa preflight network hard-forked at **2026-04-27 13:00 UTC**. The post-fork chain runs **`4.0.0-preflight-3f038cb`**, which raises the **transaction protocol version to 5.0.0**. Pre-fork builds — including the stop-slot release `4.0.0-preflight-stop-2967b39` — are no longer compatible.
-`-g | --genesis-ledger`: path to the genesis ledger file
+When upgrading a preflight archive database, install the matching `mina-archive-mesa=4.0.0-preflight-3f038cb` package so the archive node speaks the new transaction protocol.
-`-s | --source-db`: connection string to the database to be migrated
+:::
-`-t | --target-db`: connection string to the database that will hold the migrated data
+:::info Choosing the Mesa archive version
-`-b | --blocks-bucket`: name of the precomputed blocks bucket. Precomputed blocks are assumed to be named with format: `{network}-{height}-{state_hash}.json`
+The commands below use `
+:::caution
-Below it's the description in detail of all the upgrade steps and what which node operator type should do to in each step.
+- Mina APIs are still under construction, so these endpoints may change.
+- By default, the GraphQL port is bound to localhost. Exposing the GraphQL API to the internet allows anyone to send Mina from the accounts known to the daemon.
-## Pre-Upgrade
+:::
-- During the Pre-Upgrade phase, node operators should prepare for the upcoming upgrade. The most important steps are:
- - Review the [upgrade readiness checklist](https://docs.google.com/document/d/1rTmJvyaK33dWjJXMOSiUIGgf8z7turxolGHUpVHNxEU/edit#heading=h.2hqz0ixwjk3f) to confirm they have covered the required steps.
- - Upgrade their nodes to the 1.4.1 stable version
- - Ensure servers are provisioned to run Berkeley nodes, meeting the new hardware requirements
- - Upgrade their nodes to the node version [3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3), with stop-slots, when this version becomes available
- - Start the archive node initial migration if they run archive nodes and wish to perform the migration in a decentralized manner
+The Mina daemon exposes a [GraphQL API](https://graphql.org/) used to request information from and submit commands to a running node.
-**Please note:** a simplified Node Status service will be part of the upgrade tooling and enabled by default in Pre-Upgrade release with the stop-slots ([3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3)). This feature will allow for a safe upgrade by monitoring the amount of upgraded active stake. Only non-sensitive data will be reported. If operators are not comfortable sharing their node version, they will have the option to disable the node version reports by using the appropriate node flag `--node-stats-type none`
+To use the GraphQL API, connect your GraphQL client to `http://localhost:3085/graphql` or open in your browser to use the [GraphiQL IDE](https://github.com/graphql/graphiql).
-### Block Producers and SNARK Workers
-1. Review the [upgrade readiness checklist](https://docs.google.com/document/d/1rTmJvyaK33dWjJXMOSiUIGgf8z7turxolGHUpVHNxEU).
-1. Provision servers that meet the minimum hardware requirements, including the new 32GB RAM requirement and support for _AVX_ and _BMI2_ CPU instructions.
-1. Upgrade nodes to node version [3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3) ([3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3) has built-in stop slots).
+- By default, an HTTP server runs on port `3085`. You can configure a different port, use the `-rest-port` flag with the daemon startup command.
-### Archive Node Operators and Rosetta Operators
-- Two migration processes will be available to archive node operators: _trustless_ and _trustful_. If the archive node operator wants to perform the _trustless_ migration, they should follow these steps; otherwise, proceed to the Upgrade phase. The _trustful_ migration will rely on o1Labs database exports and Docker images to migrate the archive node database and doesn’t require any actions at this stage.
+- The default security permits only connections from `localhost`. To listen on all interfaces, add the `-insecure-rest-server` flag to the daemon startup command.
-1. Trustless migration:
- - Perform the initial archive node migration. Since Mainnet is a long-lived network, the initial migration process can take up to 48 hours, depending on your server specification and infrastructure.
- - If your Mina Daemon, archive node, or PostgreSQL database runs on different machines, the migration performance will be greatly impacted.
- - For more information on the archive node migration process, please refer to the [Archive Migration](/network-upgrades/berkeley/archive-migration) section.
-2. Upgrade all nodes to the latest stable version [3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3).
-3. Provision servers that meet the minimum hardware requirements, primarily the new 32GB RAM requirement.
-4. Upgrade their nodes to the version that includes built-in stop slots before the pre-defined _stop-transaction-slot_.
+In addition to information about the running node, the GraphQL API can return data about the network's latest blocks. However, as the blockchain's historical state is not persisted in Mina, only blocks in the node's transition frontier are returned, i.e., the last `k` blocks. For other historical data, use the [Archive Node](/node-operators/archive-node/getting-started) that is designed to retain and retrieve historical data.
-### Exchanges
-1. Make sure to test your system integration with Berkeley's new features. Pay special attention to:
- - If you use the **o1labs/client-sdk** library to sign transactions, you should switch to **[mina-signer](https://www.npmjs.com/package/mina-signer)**. o1labs/client-sdk was **deprecated** some time ago and will be **unusable** once the network has been upgraded. Please review the migration instructions in [Appendix](/network-upgrades/berkeley/appendix).
- - If you rely on the archive node SQL database tables, please review the schema changes in Appendix 1 of this document.
-2. Upgrade all nodes to the latest stable version [3.0.3](https://github.com/MinaProtocol/mina/releases/tag/3.0.3).
-3. Provision servers that meet the minimum hardware requirements, particularly the new 32GB RAM requirement.
-4. Upgrade your nodes to the version that includes built-in stop slots before the pre-defined _stop-transaction-slot_.
+The full Mina GraphQL schema is available [https://github.com/MinaProtocol/mina/blob/develop/graphql_schema.json](https://github.com/MinaProtocol/mina/blob/develop/graphql_schema.json).
-***
+### Queries
-## State Finalization
-- Between the predefined _stop-transaction-slot_ and _stop-network-slot_, a stabilization period of 100 slots will occur. During this phase, the network consensus will not accept new blocks with transactions on them, including coinbase transactions. The state finalization period ensures all nodes reach a consensus on the latest network state before the upgrade.
-- During the state finalization slots, it is crucial to maintain a high block density. Therefore, block producers and SNARK workers shall continue running their nodes to support the network's stability and security.
-- Archive nodes should also continue to execute to ensure finalized blocks are in the database and can be migrated, preserving the integrity and accessibility of the network's history.
+The Mina GraphQL API has a number of [queries](/node-operators/validator-node/querying-data) to extract data from a running node. [GraphQL queries](https://graphql.org/learn/queries/) allow specifying the data to be returned in the response. For example, to get the latest block and creator information known to the daemon:
-### Block Producers and SNARK Workers
-1. It is crucial for the network's successful upgrade that all block producers and SNARK workers maintain their block-producing nodes up and running throughout the state finalization phase.
-2. If you are running multiple daemons like is common with many operators, you can run one single node at this stage.
-3. If you are a Delegation Program operator, remember that your uptime data will continue to be tracked during the state finalization phase and will be considered for the delegation grant in the following epoch.
+```
+query {
+ bestChain(maxLength: 1) {
+ creator
+ stateHash
+ protocolState {
+ consensusState {
+ blockHeight
+ }
+ previousStateHash
+ }
+ transactions {
+ coinbase
+ }
+ }
+}
+```
-### Archive Node Operators and Rosetta Operators
-**If you plan to do the _trustful_ migration, you can skip this step.**
-If you are doing the trustless migration, then:
-1. Continue to execute the archive node to ensure finalized blocks are in the database and can be migrated.
-2. Continue to run incremental archive node migrations until after the network stops at the stop-network slot.
-3. For more information on the archive node migration process, please refer to the [Archive Migration](/network-upgrades/berkeley/archive-migration) section
+The following query requests all pending transactions in the transaction pool together with their fees. This query can be used to generate an estimate of a suggested fee for a transaction:
-### Exchanges
+```
+query {
+ pooledUserCommands {
+ id,
+ fee
+ }
+}
+```
-Exchanges shall disable MINA deposits and withdrawals during the state finalization period (the period between _stop-transaction-slot_ and _stop-network-slot_) since any transactions after the _stop-transaction-slot_ will not be part of the upgraded chain.
+:::tip
-Remember that although you might be able to submit transactions, the majority of the block producers will be running a node that discards any blocks with transactions.
+The memo field returned for a transaction is [Base58Check encoded](https://en.bitcoin.it/wiki/Base58Check_encoding).
-***
+:::
-## Upgrade
+```
+query {
+ account(publicKey: "We recommend that you save some of your SNARK work data logs. You can also share the logs with us if you’re interested in helping out with data checks.
-``` -SELECT -height as blockheight, -global_slot_since_genesis as globalslotsincegenesis, -global_slot_since_hard_fork as globalslot, -state_hash as statehash, -parent_hash as parenthash, -ledger_hash as ledgerhash, -to_char(to_timestamp(cast ("timestamp" as bigint) / 1000) AT TIME ZONE 'UTC', 'YYYY-MM-DD"T"HH24:MI:SS') || '.' || - LPAD(((cast("timestamp" as bigint) % 1000)::text), 3, '0') || 'Z' as datetime -FROM blocks -WHERE id in (SELECT MAX(id) FROM blocks); +::: -``` +### Pre-requisites -**Example 6** Identify blocks with missing parents, between blockheight 500 and blockheight 5000 -``` -SELECT height -FROM blocks -WHERE parent_id is null AND height >= 500 AND height <= 5000 and height > 1; +Make sure you updated your node to at least release (3.0.0+): -``` +## How to set up the uptime system ---- -url: /node-operators/archive-node ---- +The SNARK-work-based uptime system is built into the mina daemon. The new uptime tracking system no longer requires importing your keypair and supports a new flag `--uptime-submitter-key`, which takes the path to your private key, just like `--block-producer-key`. -# About Archive Nodes +To get started, pass in the following information to the daemon: -Mina nodes are succinct by default, so they don't need to maintain historical information about the network, block, or transactions. An archive node is a Mina node that stores the historical chain data to a persistent data source, PostgreSQL, so it can later be retrieved. For some use cases, it is useful to maintain this historical data on an archive node. +- The path to the private key with the flag: +`--uptime-submitter-keyWe recommend that you save some of your SNARK work data logs. You can also share the logs with us if you’re interested in helping out with data checks.
+### mina accounts help +``` +explain a given subcommand (perhaps recursively) -::: + mina accounts help [SUBCOMMAND] -### Pre-requisites +=== flags === -Make sure you updated your node to at least release (3.0.0+): + [-expand-dots] expand subcommands in recursive help + [-flags] show flags as well in recursive help + [-recursive] show subcommands of subcommands, etc. + [-help] print this help text and exit + (alias: -?) -## How to set up the uptime system +``` -The SNARK-work-based uptime system is built into the mina daemon. The new uptime tracking system no longer requires importing your keypair and supports a new flag `--uptime-submitter-key`, which takes the path to your private key, just like `--block-producer-key`. +## mina client +``` +Lightweight client commands -To get started, pass in the following information to the daemon: + mina client SUBCOMMAND -- The path to the private key with the flag: -`--uptime-submitter-key