> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Versioned Transactions

> Explore the core Solana concepts: transactions, versioned transactions, enabling additional functionality in the Solana runtime, address lookup tables, and more.

Versioned Transactions are the transaction formats that allow for additional
functionality in the Solana runtime, beyond what the original `legacy` format
supports.

While changes to onchain programs are **NOT** required to support the new
functionality of versioned transactions (or for backwards compatibility),
developers **WILL** need update their client side code to prevent
[errors due to different transaction versions](#max-supported-transaction-version).

## Current Transaction Versions

The Solana runtime supports three transaction versions:

| Version  | Size limit  | Address Lookup Tables | Resource limits            |
| -------- | ----------- | --------------------- | -------------------------- |
| `legacy` | 1,232 bytes | Not supported         | ComputeBudget instructions |
| `0`      | 1,232 bytes | Supported             | ComputeBudget instructions |
| `1`      | 4,096 bytes | Removed               | Set in the message config  |

Jump to the format you are building with:

- [V0 transactions](#v0-transactions) — raise the effective account limit with
  [Address Lookup Tables](/developers/cookbook/transactions/lookup-tables)
- [V1 transactions](#v1-transactions) — fit more into a single transaction, and
  set resource limits in the message itself

For the wire layout of each format, see
[versioned transactions](/developers/docs/core/transactions/versioned-transactions).

## Max supported transaction version

All RPC requests that return a transaction **_should_** specify the highest
version of transactions they will support in their application using the
`maxSupportedTransactionVersion` option, including
[`getBlock`](/developers/docs/rpc/http/getblock) and
[`getTransaction`](/developers/docs/rpc/http/gettransaction).

An RPC request will fail if a Versioned Transaction is returned that is higher
than the set `maxSupportedTransactionVersion`. (i.e. if a version `0`
transaction is returned when `legacy` is selected)

> WARNING: If no `maxSupportedTransactionVersion` value is set, then only
> `legacy` transactions will be allowed in the RPC response. Therefore, your RPC
> requests **WILL** fail if any version `0` transactions are returned. The same
> applies one version up: requests that set `0` will fail on version `1`
> transactions. Set the value to the integer `1` to support every format.

## How to set max supported version

You can set the `maxSupportedTransactionVersion` using both the
[`@solana/web3.js`](https://solana-foundation.github.io/solana-web3.js/v1.x/)
library and JSON formatted requests directly to an RPC endpoint.

### Using web3.js

Using the
[`@solana/web3.js`](https://solana-foundation.github.io/solana-web3.js/v1.x/)
library, you can retrieve the most recent block or get a specific transaction:

<Warning>
  **`@solana/web3.js` 1.x is no longer actively maintained**

  It receives critical fixes only. Use [Kit](/developers/docs/clients/official/javascript#solana-kit) for new code. To migrate existing code, follow the [Kit upgrade guide](https://www.solanakit.com/docs/upgrade-guide), or the [web3.js v3 migration guide](https://github.com/solana-foundation/solana-web3.js/blob/main/docs/web3js-v1-to-v3-migration.md) to keep the class-based API.

  To run this code, install 1.x with `npm install @solana/web3.js@1`. A plain `npm install @solana/web3.js` installs v3, which this code doesn't run on.
</Warning>

```js
// connect to the `devnet` cluster and get the current `slot`
const connection = new web3.Connection(web3.clusterApiUrl("devnet"));
const slot = await connection.getSlot();

// get the latest block (allowing for v0 and v1 transactions)
const block = await connection.getBlock(slot, {
  maxSupportedTransactionVersion: 1
});

// get a specific transaction (allowing for v0 and v1 transactions)
const getTx = await connection.getTransaction(
  "2mewRYCGQfofdhKk3dhPgYvcMbuJena3gLwPgdEAdFhLbxtMPTxAaSeAhAYGfc9vXXb19VjxedwxMp7xFEtdK1XL",
  {
    maxSupportedTransactionVersion: 1
  }
);
```

### JSON requests to the RPC

Using a standard JSON formatted POST request, you can set the
`maxSupportedTransactionVersion` when retrieving a specific block. Slot
`518104023` holds legacy, v0 and v1 transactions; any recent slot from
[`getSlot`](/developers/docs/rpc/http/getslot) works too:

```shell
curl https://api.devnet.solana.com -X POST -H "Content-Type: application/json" -d \
'{"jsonrpc": "2.0", "id":1, "method": "getBlock", "params": [518104023, {
  "encoding":"json",
  "maxSupportedTransactionVersion":1,
  "transactionDetails":"full",
  "rewards":false
}]}'
```

## V0 transactions

Version `0` transactions can be created similar to the older method of creating
transactions. There are differences in using certain libraries that should be
noted.

Below is an example of how to create a Versioned Transaction, using the
`@solana/web3.js` library, to send perform a SOL transfer between two accounts.

<Warning>
  **`@solana/web3.js` 1.x is no longer actively maintained**

  It receives critical fixes only. Use [Kit](/developers/docs/clients/official/javascript#solana-kit) for new code. To migrate existing code, follow the [Kit upgrade guide](https://www.solanakit.com/docs/upgrade-guide), or the [web3.js v3 migration guide](https://github.com/solana-foundation/solana-web3.js/blob/main/docs/web3js-v1-to-v3-migration.md) to keep the class-based API.

  To run this code, install 1.x with `npm install @solana/web3.js@1`. A plain `npm install @solana/web3.js` installs v3, which this code doesn't run on.
</Warning>

### Notes:

- `payer` is a valid `Keypair` wallet, funded with SOL
- `toAccount` a valid `Keypair`

Firstly, import the web3.js library and create a `connection` to your desired
cluster.

We then define the recent `blockhash` and `minRent` we will need for our
transaction and the account:

```js
const web3 = require("@solana/web3.js");

// connect to the cluster and get the minimum rent for rent exempt status
const connection = new web3.Connection(web3.clusterApiUrl("devnet"));
let minRent = await connection.getMinimumBalanceForRentExemption(0);
let blockhash = await connection
  .getLatestBlockhash()
  .then((res) => res.blockhash);
```

Create an `array` of all the `instructions` you desire to send in your
transaction. In this example below, we are creating a simple SOL transfer
instruction:

```js
// create an array with your desired `instructions`
const instructions = [
  web3.SystemProgram.transfer({
    fromPubkey: payer.publicKey,
    toPubkey: toAccount.publicKey,
    lamports: minRent
  })
];
```

Next, construct a `MessageV0` formatted transaction message with your desired
`instructions`:

```js
// create v0 compatible message
const messageV0 = new web3.TransactionMessage({
  payerKey: payer.publicKey,
  recentBlockhash: blockhash,
  instructions
}).compileToV0Message();
```

Then, create a new `VersionedTransaction`, passing in our v0 compatible message:

```js
const transaction = new web3.VersionedTransaction(messageV0);

// sign your transaction with the required `Signers`
transaction.sign([payer]);
```

You can sign the transaction by either:

- passing an array of `signatures` into the `VersionedTransaction` method, or
- call the `transaction.sign()` method, passing an array of the required
  `Signers`

> NOTE: After calling the `transaction.sign()` method, all the previous
> transaction `signatures` will be fully replaced by new signatures created from
> the provided in `Signers`.

After your `VersionedTransaction` has been signed by all required accounts, you
can send it to the cluster and `await` the response:

```js
// send our v0 transaction to the cluster
const txId = await connection.sendTransaction(transaction);
console.log(`https://explorer.solana.com/tx/${txId}?cluster=devnet`);
```

> NOTE: Unlike `legacy` transactions, sending a `VersionedTransaction` via
> `sendTransaction` does **NOT** support transaction signing via passing in an
> array of `Signers` as the second parameter. You will need to sign the
> transaction before calling `connection.sendTransaction()`.

## V1 transactions

Version `1` raises the transaction size limit to 4,096 bytes and moves the
resource limits out of ComputeBudget instructions and into the message itself.
Address Lookup Tables are not available on v1 — every account a v1 transaction
touches is listed in the message.

### Building a v1 transaction

A v1 message is assembled through the same pipeline as a legacy or v0 one; the
difference is the config it carries. The compute unit limit and loaded accounts
data size limit both default to zero, so a v1 transaction that leaves them unset
always fails.

<Tabs>
<Tab title="Kit">
<div className="sol-tab-label">Kit</div>

```ts
import {
  appendTransactionMessageInstruction,
  assertIsTransactionWithBlockhashLifetime,
  createClient,
  createTransactionMessage,
  generateKeyPairSigner,
  getSignatureFromTransaction,
  lamports,
  pipe,
  sendAndConfirmTransactionFactory,
  setTransactionMessageConfig,
  setTransactionMessageFeePayerSigner,
  setTransactionMessageLifetimeUsingBlockhash,
  signTransactionMessageWithSigners,
} from "@solana/kit";
import { rpcAirdrop, solanaRpc } from "@solana/kit-plugin-rpc";
import { airdropPayer, payer } from "@solana/kit-plugin-signer";
import { getTransferSolInstruction } from "@solana-program/system";

const sender = await generateKeyPairSigner();
const recipient = await generateKeyPairSigner();

const client = await createClient()
  .use(payer(sender))
  .use(
    solanaRpc({
      rpcUrl: "http://localhost:8899",
      rpcSubscriptionsUrl: "ws://localhost:8900",
    }),
  )
  .use(rpcAirdrop())
  .use(airdropPayer(lamports(1_000_000_000n)));

const { value: latestBlockhash } = await client.rpc.getLatestBlockhash().send();

// A v1 message is assembled through the same pipeline as a legacy or v0 one.
// The difference is the config: a v1 transaction carries its resource limits in
// the message itself, so no ComputeBudget instructions are compiled in.
const transactionMessage = pipe(
  createTransactionMessage({ version: 1 }),
  (m) => setTransactionMessageFeePayerSigner(sender, m),
  (m) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, m),
  (m) =>
    appendTransactionMessageInstruction(
      getTransferSolInstruction({
        source: sender,
        destination: recipient.address,
        amount: lamports(10_000_000n),
      }),
      m,
    ),
  // The compute unit limit and loaded accounts data size limit both default to
  // zero on v1, so a transaction that leaves them unset always fails. The
  // priority fee is an absolute total in lamports, not a price per compute
  // unit.
  (m) =>
    setTransactionMessageConfig(
      {
        computeUnitLimit: 20_000,
        loadedAccountsDataSizeLimit: 64 * 1024,
        priorityFeeLamports: 5_000n,
      },
      m,
    ),
);

const signedTransaction =
  await signTransactionMessageWithSigners(transactionMessage);
assertIsTransactionWithBlockhashLifetime(signedTransaction);

await sendAndConfirmTransactionFactory({
  rpc: client.rpc,
  rpcSubscriptions: client.rpcSubscriptions,
})(signedTransaction, { commitment: "confirmed" });

const transactionSignature = getSignatureFromTransaction(signedTransaction);
console.log("Transaction Signature:", transactionSignature);
```

<div className="sol-run" data-run="cookbook/transactions/v1-transactions/build" data-tab="Kit">
<div className="sol-run-bar"><button type="button" className="sol-run-btn">Run</button><span className="sol-run-note">Output from a local Surfpool network</span></div>
<div className="sol-run-out">

```text Output
Transaction Signature: ZXbwX8LzjRbEG4msdSaAuHAM5MNBxtz5rCcmNi14mBeh11QRWAXDx2uiciE2HVQFWRgSEzAcMt1DNsZ7CiVcumg
```

</div>
</div>

</Tab>
<Tab title="Go">
<div className="sol-tab-label">Go</div>

```go
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/solana-foundation/solana-go/v2"
	"github.com/solana-foundation/solana-go/v2/programs/system"
	"github.com/solana-foundation/solana-go/v2/rpc"
)

func main() {
	ctx := context.Background()
	client := rpc.New("http://localhost:8899")

	sender := solana.NewWallet()
	recipient := solana.NewWallet()

	_, err := client.RequestAirdrop(ctx, sender.PublicKey(), solana.LAMPORTS_PER_SOL, rpc.CommitmentConfirmed)
	if err != nil {
		panic(err)
	}
	time.Sleep(2 * time.Second)

	recent, err := client.GetLatestBlockhash(ctx, rpc.CommitmentConfirmed)
	if err != nil {
		panic(err)
	}

	// A v1 transaction carries its resource limits in the message itself, so
	// there are no ComputeBudget instructions. Both limits default to zero, so
	// set them. The priority fee is a total in lamports, not a price per unit.
	tx, err := solana.NewTransaction(
		[]solana.Instruction{
			system.NewTransferInstruction(10_000_000, sender.PublicKey(), recipient.PublicKey()).Build(),
		},
		recent.Value.Blockhash,
		solana.TransactionPayer(sender.PublicKey()),
		solana.TransactionV1Config(solana.TransactionConfig{}.
			WithComputeUnitLimit(20_000).
			WithLoadedAccountsDataSizeLimit(64*1024).
			WithPriorityFee(5_000)),
	)
	if err != nil {
		panic(err)
	}
	tx.Sign(func(solana.PublicKey) *solana.PrivateKey { return &sender.PrivateKey })

	sig, err := client.SendTransactionWithOpts(ctx, tx, rpc.TransactionOpts{
		PreflightCommitment: rpc.CommitmentConfirmed,
	})
	if err != nil {
		panic(err)
	}
	fmt.Println("Transaction Signature:", sig)
}
```

<div className="sol-run" data-run="cookbook/transactions/v1-transactions/build" data-tab="Go">
<div className="sol-run-bar"><button type="button" className="sol-run-btn">Run</button><span className="sol-run-note">Output from a local Surfpool network</span></div>
<div className="sol-run-out">

```text Output
Transaction Signature: DYarmikpyJPrMVwEZ7sUu3JG4pjfzqavdnejj4kHykz8LYqNL69WihfqUpRMJjA6XU7Nn6okF2NYzBeJdacVP1z
```

</div>
</div>

</Tab>
</Tabs>

### Estimating the resource limits

Rather than hardcoding the limits, simulate the transaction to measure them.
Simulation runs with both limits raised to the runtime maximum, so it cannot
fail for want of the resources it is measuring.

<Tabs>
<Tab title="Kit">
<div className="sol-tab-label">Kit</div>

```ts
import {
  appendTransactionMessageInstruction,
  assertIsTransactionWithBlockhashLifetime,
  createClient,
  createTransactionMessage,
  estimateAndSetResourceLimitsFactory,
  estimateResourceLimitsFactory,
  fillTransactionMessageProvisoryResourceLimits,
  generateKeyPairSigner,
  getSignatureFromTransaction,
  lamports,
  pipe,
  sendAndConfirmTransactionFactory,
  setTransactionMessageFeePayerSigner,
  setTransactionMessageLifetimeUsingBlockhash,
  setTransactionMessagePriorityFeeLamports,
  signTransactionMessageWithSigners,
} from "@solana/kit";
import { rpcAirdrop, solanaRpc } from "@solana/kit-plugin-rpc";
import { airdropPayer, payer } from "@solana/kit-plugin-signer";
import { getTransferSolInstruction } from "@solana-program/system";

const sender = await generateKeyPairSigner();
const recipient = await generateKeyPairSigner();

const client = await createClient()
  .use(payer(sender))
  .use(
    solanaRpc({
      rpcUrl: "http://localhost:8899",
      rpcSubscriptionsUrl: "ws://localhost:8900",
    }),
  )
  .use(rpcAirdrop())
  .use(airdropPayer(lamports(1_000_000_000n)));

const { value: latestBlockhash } = await client.rpc.getLatestBlockhash().send();

// The priority fee is a pricing decision that simulation cannot measure, so it
// is set directly. The two resource limits are measured below instead of
// guessed. The provisory fill writes placeholder limits so the message
// simulates at the same size it will be sent at.
const draftMessage = pipe(
  createTransactionMessage({ version: 1 }),
  (m) => setTransactionMessageFeePayerSigner(sender, m),
  (m) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, m),
  (m) =>
    appendTransactionMessageInstruction(
      getTransferSolInstruction({
        source: sender,
        destination: recipient.address,
        amount: lamports(10_000_000n),
      }),
      m,
    ),
  (m) => setTransactionMessagePriorityFeeLamports(5_000n, m),
  fillTransactionMessageProvisoryResourceLimits,
);

// Simulation runs with both limits raised to the runtime maximum, so it cannot
// fail for want of the resources it is measuring.
const estimateAndSetResourceLimits = estimateAndSetResourceLimitsFactory(
  estimateResourceLimitsFactory({ rpc: client.rpc }),
);
const transactionMessage = await estimateAndSetResourceLimits(draftMessage, {
  commitment: "confirmed",
});

// Both are measured: compute units used, and bytes of account data loaded (a
// SOL transfer only loads the System Program, whose data is its 14-byte name).
console.log("Compute unit limit:", transactionMessage.config?.computeUnitLimit);
console.log(
  "Loaded accounts data size limit (bytes):",
  transactionMessage.config?.loadedAccountsDataSizeLimit,
);

const signedTransaction =
  await signTransactionMessageWithSigners(transactionMessage);
assertIsTransactionWithBlockhashLifetime(signedTransaction);

await sendAndConfirmTransactionFactory({
  rpc: client.rpc,
  rpcSubscriptions: client.rpcSubscriptions,
})(signedTransaction, { commitment: "confirmed" });

// The estimate is the exact cost of one simulated run, with nothing to spare.
// Add a margin before relying on it in production.
console.log(
  "Transaction Signature:",
  getSignatureFromTransaction(signedTransaction),
);
```

<div className="sol-run" data-run="cookbook/transactions/v1-transactions/estimate" data-tab="Kit">
<div className="sol-run-bar"><button type="button" className="sol-run-btn">Run</button><span className="sol-run-note">Output from a local Surfpool network</span></div>
<div className="sol-run-out">

```text Output
Compute unit limit: 150
Loaded accounts data size limit (bytes): 14
Transaction Signature: 23M8HQsjE1Kaj7hGbXsNQ1i9Wif6zwh2iWatJSpuXi8GtrxcuWswpXZsMtJ7n2anPoUn4hMqALhrwrzXmUSkiRAh
```

</div>
</div>

</Tab>
<Tab title="Go">
<div className="sol-tab-label">Go</div>

```go
package main

import (
	"context"
	"fmt"
	"time"

	"github.com/solana-foundation/solana-go/v2"
	"github.com/solana-foundation/solana-go/v2/programs/system"
	"github.com/solana-foundation/solana-go/v2/rpc"
)

func main() {
	ctx := context.Background()
	client := rpc.New("http://localhost:8899")

	sender := solana.NewWallet()
	recipient := solana.NewWallet()

	_, err := client.RequestAirdrop(ctx, sender.PublicKey(), solana.LAMPORTS_PER_SOL, rpc.CommitmentConfirmed)
	if err != nil {
		panic(err)
	}
	time.Sleep(2 * time.Second)

	recent, err := client.GetLatestBlockhash(ctx, rpc.CommitmentConfirmed)
	if err != nil {
		panic(err)
	}
	transfer := system.NewTransferInstruction(10_000_000, sender.PublicKey(), recipient.PublicKey()).Build()
	buildTx := func(config solana.TransactionConfig) *solana.Transaction {
		tx, err := solana.NewTransaction(
			[]solana.Instruction{transfer},
			recent.Value.Blockhash,
			solana.TransactionPayer(sender.PublicKey()),
			solana.TransactionV1Config(config.WithPriorityFee(5_000)),
		)
		if err != nil {
			panic(err)
		}
		tx.Sign(func(solana.PublicKey) *solana.PrivateKey { return &sender.PrivateKey })
		return tx
	}

	// Simulate with both limits at the runtime maximum, then read what the
	// transaction actually used.
	sim, err := client.SimulateTransactionWithOpts(ctx, buildTx(solana.TransactionConfig{}.
		WithComputeUnitLimit(1_400_000).
		WithLoadedAccountsDataSizeLimit(64*1024*1024),
	), &rpc.SimulateTransactionOpts{Commitment: rpc.CommitmentConfirmed})
	if err != nil {
		panic(err)
	}
	computeUnits := uint32(*sim.Value.UnitsConsumed)
	dataSize := *sim.Value.LoadedAccountsDataSize
	fmt.Println("Compute unit limit:", computeUnits)
	fmt.Println("Loaded accounts data size limit:", dataSize)

	// The estimate is the exact cost of one run; add a margin in production.
	tx := buildTx(solana.TransactionConfig{}.
		WithComputeUnitLimit(computeUnits).
		WithLoadedAccountsDataSizeLimit(dataSize))
	sig, err := client.SendTransactionWithOpts(ctx, tx, rpc.TransactionOpts{
		PreflightCommitment: rpc.CommitmentConfirmed,
	})
	if err != nil {
		panic(err)
	}
	fmt.Println("Transaction Signature:", sig)
}
```

<div className="sol-run" data-run="cookbook/transactions/v1-transactions/estimate" data-tab="Go">
<div className="sol-run-bar"><button type="button" className="sol-run-btn">Run</button><span className="sol-run-note">Output from a local Surfpool network</span></div>
<div className="sol-run-out">

```text Output
Compute unit limit: 150
Loaded accounts data size limit: 149
Transaction Signature: 3VDdt7FnqmMDNVshHUikdHFJuooLVpCx8qtpobrth8V6hAfjCkXPrauXAiGASKF68BTX5b67EUUXKCmBwDLr8eSW
```

</div>
</div>

</Tab>
</Tabs>

<Warning>
  The estimate is the exact cost of one simulated run, with nothing to spare.
  Add a margin before relying on it in production.
</Warning>

### Reading a v1 transaction

Fetching a v1 transaction requires setting
[`maxSupportedTransactionVersion`](#max-supported-transaction-version) to the
integer `1`. The compiled message stores the config as a bitmask plus a
positional list, so decompile it to address the fields by name.

<Tabs>
<Tab title="Kit">
<div className="sol-tab-label">Kit</div>

```ts
import {
  decompileTransactionMessage,
  getBase64Encoder,
  getCompiledTransactionMessageDecoder,
  getTransactionDecoder,
} from "@solana/kit";

// Reading a v1 transaction requires opting in. The integer 1 is mandatory:
// omitting the parameter, or passing 0, fails on a v1 transaction rather than
// returning it in a degraded form.
const fetched = await client.rpc
  .getTransaction(transactionSignature, {
    commitment: "confirmed",
    encoding: "base64",
    maxSupportedTransactionVersion: 1,
  })
  .send();
if (fetched === null) {
  throw new Error("the transaction just sent was not found");
}

// The compiled message stores the config as a bitmask plus a positional list,
// so it is decompiled to address the fields by name. Decompiling fetches no
// accounts, because v1 does not support address lookup tables.
const wireTransaction = getBase64Encoder().encode(fetched.transaction[0]);
const transaction = getTransactionDecoder().decode(wireTransaction);
const compiledMessage = getCompiledTransactionMessageDecoder().decode(
  transaction.messageBytes,
);
const message = decompileTransactionMessage(compiledMessage);

console.log("Version:", message.version);
if ("config" in message) {
  // Scanning the instruction list for ComputeBudget instructions finds nothing
  // here — on v1 the limits live in the config.
  console.log("Compute unit limit:", message.config?.computeUnitLimit);
  console.log("Priority fee (lamports):", message.config?.priorityFeeLamports);
}
```

<div className="sol-run" data-run="cookbook/transactions/v1-transactions/read" data-tab="Kit">
<div className="sol-run-bar"><button type="button" className="sol-run-btn">Run</button><span className="sol-run-note">Output from a local Surfpool network</span></div>
<div className="sol-run-out">

```text Output
Version: 1
Compute unit limit: 20000
Priority fee (lamports): 5000n
```

</div>
</div>

</Tab>
<Tab title="Go">
<div className="sol-tab-label">Go</div>

```go
// Reading a v1 transaction requires opting in with version 1.
maxVersion := rpc.MaxSupportedTransactionVersion1
fetched, err := client.GetTransaction(ctx, sig, &rpc.GetTransactionOpts{
	Commitment:                     rpc.CommitmentConfirmed,
	Encoding:                       solana.EncodingBase64,
	MaxSupportedTransactionVersion: &maxVersion,
})
if err != nil {
	panic(err)
}
read, err := fetched.Transaction.GetTransaction()
if err != nil {
	panic(err)
}

// On v1 the limits live in the message config, not in instructions.
config := read.Message.TransactionConfig
fmt.Println("Is v1:", read.Message.GetVersion() == solana.MessageVersionV1)
fmt.Println("Compute unit limit:", *config.ComputeUnitLimit)
fmt.Println("Priority fee (lamports):", *config.PriorityFee)
```

<div className="sol-run" data-run="cookbook/transactions/v1-transactions/read" data-tab="Go">
<div className="sol-run-bar"><button type="button" className="sol-run-btn">Run</button><span className="sol-run-note">Output from a local Surfpool network</span></div>
<div className="sol-run-out">

```text Output
Is v1: true
Compute unit limit: 20000
Priority fee (lamports): 5000
```

</div>
</div>

</Tab>
</Tabs>

## More Resources

- using
  [Versioned Transactions for Address Lookup Tables](/developers/cookbook/transactions/lookup-tables#how-to-create-an-address-lookup-table)
- view an
  [example of a v0 transaction](https://explorer.solana.com/tx/h9WQsqSUYhFvrbJWKFPaXximJpLf6Z568NW1j6PBn3f7GPzQXe9PYMYbmWSUFHwgnUmycDNbEX9cr6WjUWkUFKx/?cluster=devnet)
  on Solana Explorer
- read the
  [accepted proposal](https://docs.anza.xyz/proposals/versioned-transactions)
  for Versioned Transaction and Address Lookup Tables
- read about the
  [v1 message format](/developers/docs/core/transactions/versioned-transactions#v1-format)
  and how its resource limits are encoded
