diff --git a/src/pages/guide/node/network-upgrades.mdx b/src/pages/guide/node/network-upgrades.mdx
index 0856818c..a1d25ab8 100644
--- a/src/pages/guide/node/network-upgrades.mdx
+++ b/src/pages/guide/node/network-upgrades.mdx
@@ -36,17 +36,19 @@ For detailed release notes and binaries, see the [Changelog](/changelog).
| | |
|---|---|
-| **Scope** | Enhanced access keys with periodic limits, call scoping, and an authorization ABI update; signature verification precompile; virtual addresses for TIP-20 deposit forwarding; and security hardening and gas correctness fixes |
-| **TIPs** | [TIP-1011: Enhanced Access Key Permissions](/protocol/tips/tip-1011), [TIP-1020: Signature Verification Precompile](/protocol/tips/tip-1020), [TIP-1022: Virtual Addresses for TIP-20 Deposit Forwarding](/protocol/tips/tip-1022), TIP-1038: T3 security hardening and gas correctness fixes |
+| **Scope** | Enhanced access keys with periodic limits, call scoping, and an authorization ABI update; signature verification precompile; and virtual addresses for TIP-20 deposit forwarding |
+| **TIPs** | [TIP-1011: Enhanced Access Key Permissions](/protocol/tips/tip-1011), [TIP-1020: Signature Verification Precompile](/protocol/tips/tip-1020), [TIP-1022: Virtual Addresses for TIP-20 Deposit Forwarding](/protocol/tips/tip-1022) |
| **Details** | [T3 network upgrade](/protocol/upgrades/t3) |
| **Release** | T3-compatible release coming soon |
| **Testnet** | Moderato: Apr 22, 2026 16:00 CEST (unix: TBD) |
| **Mainnet** | Presto: Apr 27, 2026 16:00 CEST (unix: TBD) |
| **Priority** | Required |
-All node operators should upgrade before the Moderato activation date, even if they do not plan to use the new T3 feature set directly.
+### Who is affected?
-Partners that create or rotate access keys should also review the T3 upgrade page. Existing authorized access keys remain valid, but key authorization flows must move to the new TIP-1011 ABI after activation.
+Partners that directly call `AccountKeychain.authorizeKey(...)` or manually encode `key_authorization` to create or rotate access keys should also review the T3 upgrade page. Existing authorized access keys remain valid, but those low-level authorization flows must move to the new TIP-1011 format post-T3.
+
+Partners that index TIP-20 transfers should also review the T3 upgrade page. Virtual-address forwarding emits two-hop `Transfer` events, so raw transfer lists and counts will be misleading unless that pair is handled as one logical deposit.
---
diff --git a/src/pages/guide/tempo-transaction/index.mdx b/src/pages/guide/tempo-transaction/index.mdx
index 69a6b0ba..6f4f9aab 100644
--- a/src/pages/guide/tempo-transaction/index.mdx
+++ b/src/pages/guide/tempo-transaction/index.mdx
@@ -2,8 +2,9 @@
description: Learn how to use Tempo Transactions for configurable fee tokens, fee sponsorship, batch calls, access keys, and concurrent execution.
---
-import { Cards, Card } from 'vocs'
+import { Cards, Card, Tabs, Tab } from 'vocs'
import TempoTxProperties from '../../../snippets/tempo-tx-properties.mdx'
+import TempoTxPropertiesPostT3 from '../../../snippets/tempo-tx-properties-post-t3.mdx'
## Use Tempo Transactions
@@ -83,4 +84,15 @@ If you are an EVM smart contract developer, see the [Tempo extension for Foundry
## Properties
-
+:::info[T3 comparison]
+The `Current network` tab shows the pre-T3 Tempo Transaction shape that is live today. The `Post-T3` tab shows the access-key and authorization changes that activate with T3.
+:::
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/protocol/tip20-rewards/spec.mdx b/src/pages/protocol/tip20-rewards/spec.mdx
index 6380b93d..47cb4b63 100644
--- a/src/pages/protocol/tip20-rewards/spec.mdx
+++ b/src/pages/protocol/tip20-rewards/spec.mdx
@@ -4,12 +4,22 @@ description: Technical specification for the TIP-20 reward distribution system u
# TIP-20 Rewards Distribution
+:::info[T3 will change this spec]
+The [T3 network upgrade](/protocol/upgrades/t3) will update this specification. The sections below describe the currently active behavior. See [Upcoming changes](#upcoming-changes) for the upcoming deltas.
+:::
+
## Abstract
An opt-in, scalable, pro-rata reward distribution mechanism built into TIP-20 tokens. The system uses a "reward-per-token" accumulator pattern to distribute rewards proportionally to opted-in holders without requiring staking or per-holder iteration. Rewards are distributed instantly; time-based streaming distributions are planned for a future upgrade.
## Motivation
Many applications require pro-rata distribution of tokens to existing holders (incentive programs, deterministic inflation, staking rewards). Building this into TIP-20 allows efficient distribution without forcing users to stake tokens elsewhere or requiring distributors to loop over all holders.
+## Upcoming changes
+
+T3 updates the TIP-20 rewards spec through [TIP-1022](/protocol/tips/tip-1022) in one place:
+
+- `setRewardRecipient(...)` will reject [TIP-1022](/protocol/tips/tip-1022) virtual addresses. Reward recipients must remain canonical accounts rather than forwarding aliases, because reward assignment is not a TIP-20 forwarding path.
+
## Specification
The rewards mechanism allows anyone to distribute token rewards to opted-in holders proportionally based on holdings. Users must opt in to receiving rewards and may delegate rewards to a recipient address.
diff --git a/src/pages/protocol/tip20/spec.mdx b/src/pages/protocol/tip20/spec.mdx
index b649f95a..e346efc6 100644
--- a/src/pages/protocol/tip20/spec.mdx
+++ b/src/pages/protocol/tip20/spec.mdx
@@ -4,6 +4,10 @@ description: Technical specification for TIP-20, the optimized token standard ex
# TIP20
+:::info[T3 will change this spec]
+The [T3 network upgrade](/protocol/upgrades/t3) will update this specification. The sections below describe the currently active behavior. See [Upcoming changes](#upcoming-changes) for the upcoming deltas.
+:::
+
## Abstract
TIP20 is a suite of precompiles that provide a built-in optimized token implementation in the core protocol. It extends the ERC-20 token standard with built-in functionality like memo fields and reward distribution.
@@ -12,6 +16,15 @@ All major stablecoins today use the ERC-20 token standard. While ERC-20 provides
TIP-20 extends ERC-20, building these features into precompiled contracts that anyone can permissionlessly deploy on Tempo. This makes token operations much more efficient, allows issuers to quickly set up on Tempo, and simplifies integrations since it ensures standardized behavior across tokens.
It also enables deeper integration with token-specific Tempo features like paying gas in stablecoins and payment lanes.
+## Upcoming changes
+
+T3 updates TIP-20 behavior through [TIP-1022](/protocol/tips/tip-1022). All changes below come from TIP-1022:
+
+- [TIP-1022](/protocol/tips/tip-1022) adds virtual-address recipient resolution for recipient-bearing TIP-20 paths: `transfer`, `transferFrom`, `transferWithMemo`, `transferFromWithMemo`, `mint`, and `mintWithMemo`.
+- When a TIP-20 operation targets a registered virtual address, the effective recipient becomes the registered master wallet before recipient authorization and mint-recipient checks run.
+- Forwarded virtual-address deposits appear as two-hop standard `Transfer` events in the same transaction. Indexers and explorers should collapse that pair into one logical deposit to the resolved master wallet.
+- Virtual addresses are valid TIP-20 recipients on those paths, but they remain forwarding aliases rather than canonical TIP-20 holders. Non-TIP-20 tokens sent to a virtual address do not forward.
+
## Specification
TIP-20 tokens support standard fungible token operations such as transfers, mints, and burns. They also support transfers, mints, and burns with an attached 32-byte memo; a role-based access control system for token administrative operations; and a system for opt-in [reward distribution](/protocol/tip20-rewards/spec).
diff --git a/src/pages/protocol/tip403/spec.mdx b/src/pages/protocol/tip403/spec.mdx
index d60e5b8b..b5df3c6c 100644
--- a/src/pages/protocol/tip403/spec.mdx
+++ b/src/pages/protocol/tip403/spec.mdx
@@ -4,6 +4,10 @@ description: Technical specification for TIP-403, the policy registry system ena
# Overview
+:::info[T3 will change this spec]
+The [T3 network upgrade](/protocol/upgrades/t3) will update this specification. The sections below describe the currently active behavior. See [Upcoming changes](#upcoming-changes) for the upcoming deltas.
+:::
+
## Abstract
TIP-403 provides a policy registry system that allows TIP-20 tokens to inherit access control and compliance policies. The registry supports two types of policies (whitelist and blacklist) and includes special built-in policies for common use cases. Policies can be shared across multiple tokens, enabling consistent compliance enforcement.
@@ -14,6 +18,13 @@ Token issuers often need to implement compliance policies such as KYC/AML requir
TIP-403 addresses this by providing a centralized registry that tokens can reference for authorization decisions. This enables consistent policy enforcement across multiple tokens and reduces implementation complexity for token issuers.
+## Upcoming changes
+
+T3 updates TIP-403 interactions with token recipients through [TIP-1022](/protocol/tips/tip-1022) as follows:
+
+- Policy-configuration functions that accept literal member addresses will reject [TIP-1022](/protocol/tips/tip-1022) virtual addresses.
+- TIP-20 policy checks for virtual-address transfers and mints will run against the resolved master wallet, not the forwarding alias, so policy membership must be configured on the master address.
+
---
# Specification
diff --git a/src/pages/protocol/transactions/AccountKeychain.mdx b/src/pages/protocol/transactions/AccountKeychain.mdx
index 71f0438b..13ca24f8 100644
--- a/src/pages/protocol/transactions/AccountKeychain.mdx
+++ b/src/pages/protocol/transactions/AccountKeychain.mdx
@@ -6,14 +6,30 @@ description: Technical specification for the Account Keychain precompile managin
**Address:** `0xAAAAAAAA00000000000000000000000000000000`
+:::info[T3 will change this spec]
+The [T3 network upgrade](/protocol/upgrades/t3) will update this specification. The sections below describe the currently active behavior. See [Upcoming changes](#upcoming-changes) for the upcoming deltas.
+:::
+
## Overview
-The Account Keychain precompile manages authorized Access Keys for accounts, enabling Root Keys (e.g., passkeys) to provision scoped "secondary" Access Keys with expiry timestamps and per-TIP20 token spending limits.
+The Account Keychain precompile manages authorized Access Keys for accounts, enabling Root Keys (e.g., passkeys) to provision scoped "secondary" Access Keys with expiry timestamps and per-TIP20 token spending limits.
## Motivation
The Tempo Transaction type unlocks a number of new signature schemes, including WebAuthn (Passkeys). However, for an Account using a Passkey as its Root Key, the sender will subsequently be prompted with passkey prompts for every signature request. This can be a poor user experience for highly interactive or multi-step flows. Additionally, users would also see "Sign In" copy in prompts for signing transactions which is confusing. This proposal introduces the concept of the Root Key being able to provision a (scoped) Access Key that can be used for subsequent transactions, without the need for repetitive end-user prompting.
+## Upcoming changes
+
+T3 updates the Account Keychain specification through [TIP-1011](/protocol/tips/tip-1011) in the following ways:
+
+- [TIP-1011](/protocol/tips/tip-1011) extends `TokenLimit` with an optional recurring `period`, so spending limits can be either one-time or periodic.
+- `authorizeKey(...)` moves to the new ABI with `allowAnyCalls` and `allowedCalls`, enabling explicit call scoping during key authorization.
+- New `SelectorRule` and `CallScope` structs define per-target and per-selector allowlists, including recipient-bound rules for supported TIP-20 selectors.
+- New root-key-only functions `setAllowedCalls(...)` and `removeAllowedCalls(...)`, plus a new `getAllowedCalls(...)` view, are added for managing and inspecting call scopes.
+- `getRemainingLimit(...)` changes to return both `remaining` and `periodEnd` so callers can observe periodic reset state.
+- `updateSpendingLimit(...)` resets the remaining amount to `newLimit` but does not change the configured `period` or current `periodEnd`.
+- Access-key-signed transactions can no longer create contracts anywhere in the batch. Deployments and other `CREATE` / `CREATE2` flows must use the root key post-T3.
+
## Concepts
### Access Keys
@@ -35,7 +51,7 @@ The protocol enforces a strict hierarchy at validation time:
1. **Root Key**: The account's main key (derived from the account address)
- Can call all precompile functions
- Has no spending limits
-
+
2. **Access Keys**: Secondary authorized keys
- Cannot call mutable precompile functions (only view functions are allowed)
- Subject to per-TIP20 token spending limits
diff --git a/src/pages/protocol/transactions/index.mdx b/src/pages/protocol/transactions/index.mdx
index e3dc854c..beee9e5f 100644
--- a/src/pages/protocol/transactions/index.mdx
+++ b/src/pages/protocol/transactions/index.mdx
@@ -2,8 +2,9 @@
description: Learn about Tempo Transactions, a new EIP-2718 transaction type with passkey support, fee sponsorship, batching, and concurrent execution.
---
-import { Cards, Card } from 'vocs'
+import { Cards, Card, Tabs, Tab } from 'vocs'
import TempoTxProperties from '../../../snippets/tempo-tx-properties.mdx'
+import TempoTxPropertiesPostT3 from '../../../snippets/tempo-tx-properties-post-t3.mdx'
# Tempo Transactions
@@ -67,7 +68,18 @@ If you are an EVM smart contract developer, see the [Tempo extension for Foundry
## Properties
-
+:::info[T3 comparison]
+The `Current network` tab shows the pre-T3 Tempo Transaction shape that is live today. The `Post-T3` tab shows the access-key and authorization changes that activate with T3.
+:::
+
+
+
+
+
+
+
+
+
## Learn more
diff --git a/src/pages/protocol/transactions/spec-tempo-transaction.mdx b/src/pages/protocol/transactions/spec-tempo-transaction.mdx
index 1645e480..1d6e3476 100644
--- a/src/pages/protocol/transactions/spec-tempo-transaction.mdx
+++ b/src/pages/protocol/transactions/spec-tempo-transaction.mdx
@@ -4,6 +4,10 @@ description: Technical specification for the Tempo transaction type (EIP-2718) w
# Tempo Transaction
+:::info[T3 will change this spec]
+The [T3 network upgrade](/protocol/upgrades/t3) will update this specification. The sections below describe the currently active behavior. See [Upcoming changes](#upcoming-changes) for the upcoming deltas.
+:::
+
## Abstract
This spec introduces native protocol support for the following features, using a new Tempo transaction type:
@@ -20,6 +24,18 @@ Current accounts are limited to secp256k1 signatures and sequential nonces, crea
Users cannot leverage modern authentication methods like passkeys, applications face throughput limitations due to sequential nonces.
+## Upcoming changes
+
+T3 updates the Tempo Transaction spec through [TIP-1011](/protocol/tips/tip-1011) in the following ways:
+
+- `KeyAuthorization` expands with the [TIP-1011](/protocol/tips/tip-1011) fields `allowed_calls` and periodic `TokenLimit.period`, adding call scoping and recurring spending limits to access keys.
+- The signed post-T3 key-authorization payload remains `SignedKeyAuthorization { authorization, signature }`, but `authorization` now uses the expanded `KeyAuthorization` shape and new RLP encoding.
+- Low-level integrators that manually encode `key_authorization` must branch pre-T3 vs post-T3. The post-T3 digest and signed payload include `allowed_calls?` in addition to `expiry?` and `limits?`.
+- Access-key validation gains two new execution checks: call scopes must pass before execution begins, and access-key-signed transactions may no longer perform contract creation anywhere in the batch.
+- The Account Keychain precompile ABI changes in lockstep with T3 to support periodic limits, call-scoped authorizations, and new scope-management functions.
+- Intrinsic gas for `key_authorization` changes to account for periodic-limit state and call-scope storage. See [TIP-1011](/protocol/tips/tip-1011#intrinsic-gas-for-key-authorization) for the post-T3 slot-counting rules.
+
+
## Specification
### Transaction Type
@@ -688,16 +704,17 @@ The protocol tracks and enforces spending limits for TIP20 token transfers:
```typescript
// Define key parameters
const keyAuth = {
+ chain_id: 1,
key_type: SignatureType.P256, // 1
key_id: keyId, // address derived from public key
expiry: timestamp + 86400, // 24 hours from now (or 0 for never)
limits: [
- { token: USDG_ADDRESS, amount: 1000000000 }, // 1000 USDG (6 decimals)
- { token: DAI_ADDRESS, amount: 500000000000000000000 } // 500 DAI (18 decimals)
+ { token: USDG_ADDRESS, limit: 1000000000 }, // 1000 USDG (6 decimals)
+ { token: DAI_ADDRESS, limit: 500000000000000000000 } // 500 DAI (18 decimals)
]
};
- // Compute digest: keccak256(rlp([key_type, key_id, expiry, limits]))
+ // Compute digest: keccak256(rlp([chain_id, key_type, key_id, expiry, limits]))
const authDigest = computeAuthorizationDigest(keyAuth);
```
@@ -718,10 +735,7 @@ The protocol tracks and enforces spending limits for TIP20 token transfers:
max_fee_per_gas: 1000000000,
max_priority_fee_per_gas: 1000000000,
key_authorization: {
- key_type: keyAuth.key_type,
- expiry: keyAuth.expiry,
- limits: keyAuth.limits,
- key_id: keyAuth.key_id,
+ authorization: keyAuth,
signature: rootSignature // Root Key's signature on authDigest
},
// ... other fields
diff --git a/src/pages/protocol/upgrades/t3.mdx b/src/pages/protocol/upgrades/t3.mdx
index 6b8bef0b..31e5420a 100644
--- a/src/pages/protocol/upgrades/t3.mdx
+++ b/src/pages/protocol/upgrades/t3.mdx
@@ -1,11 +1,11 @@
---
title: T3 Network Upgrade
-description: Details and timeline for the T3 network upgrade, including enhanced access keys, signature verification, virtual addresses, and security hardening and gas correctness fixes.
+description: Details and timeline for the T3 network upgrade, including enhanced access keys, signature verification, and virtual addresses.
---
# T3 Network Upgrade
-This page summarizes the features, partner impact, and breaking changes included in the T3 network upgrade.
+This page summarizes T3 scope, partner impact, and breaking changes.
:::info[T3 is not live yet]
The features described on this page are scheduled for T3 and are not active on Moderato or Presto yet. They only become live once the T3 activation timestamps are reached.
@@ -27,7 +27,13 @@ T3 is Tempo's next network upgrade. It introduces the following changes:
- A signature verification precompile for secp256k1, P256, and WebAuthn signatures ([TIP-1020](/protocol/tips/tip-1020))
- Virtual addresses for TIP-20 deposit forwarding ([TIP-1022](/protocol/tips/tip-1022))
-**Action required for integrators:** Partners that create or update access keys should upgrade to a T3-compatible SDK release before activation.
+**Action required for integrators:** Review T3 before activation if you create or update access keys or index TIP-20 transfers.
+
+## Who is affected?
+
+- Access-key integrations that directly call `AccountKeychain.authorizeKey(...)` onchain or manually encode `key_authorization` payloads must migrate to the new TIP-1011 format after activation.
+- Explorers and indexers that surface TIP-20 transfer history or counts must handle TIP-1022 virtual-address forwarding as one logical deposit, not two independent transfers.
+- Most other integrators only need to upgrade to T3-compatible tooling. Existing authorized access keys keep working, and teams that do not adopt virtual addresses do not need code changes for TIP-1022.
## Partner impact
@@ -39,28 +45,37 @@ T3 is Tempo's next network upgrade. It introduces the following changes:
## Breaking changes
-Partners that create or update access keys should upgrade to a T3-compatible SDK release before activation.
+Breaking changes only affect two groups: access-key integrations that either manually encode `key_authorization` or directly call `AccountKeychain.authorizeKey(...)` onchain, and explorers/indexers that surface TIP-20 transfer history or counts.
-For most integrators, no action is needed beyond upgrading to T3-compatible tooling. Existing authorized access keys keep working, and Tempo Transactions that use `key_authorization` keep working.
+For most other integrators, no action is needed beyond upgrading to T3-compatible tooling. Existing authorized access keys keep working, and Tempo Transactions that use `key_authorization` continue to work through T3-compatible tooling.
### Breaking change for access-key integrations
-The only integrations that need code changes are ones that call `AccountKeychain.authorizeKey(...)` directly onchain. Before T3, those flows used the legacy authorization ABI. After T3, they must use the TIP-1011 authorization format with the updated `authorizeKey(...)` arguments. Legacy calls fail with `LegacyAuthorizeKeySelectorChanged`, sometimes surfaced as `LegacyAuthorizeKeySelectorChanged(newSelector: 0x980a6025)`.
+Only integrations that directly call `AccountKeychain.authorizeKey(...)` or manually construct `key_authorization` payloads need code changes. Before T3, those flows use the legacy authorization ABI and legacy key-authorization encoding. Post-T3, they must use the TIP-1011 authorization format with the updated `authorizeKey(...)` arguments and post-T3 `key_authorization` payload shape. Legacy calls fail with `LegacyAuthorizeKeySelectorChanged`, sometimes surfaced as `LegacyAuthorizeKeySelectorChanged(newSelector: 0x980a6025)`.
**Before activation:** Integrations must continue using the legacy `AccountKeychain.authorizeKey(...)` ABI. The TIP-1011 authorization format is not yet valid onchain.
-**After activation:** Integrations must use the TIP-1011 authorization format.
+**Post-T3:** Integrations must use the TIP-1011 authorization format.
+
+T3 also adds one new execution restriction: access-key-signed transactions can no longer create contracts. If your product used access keys for deployments, factory calls, or module-install flows that create contracts, move those transactions to a Root Key path.
+
+If you support both pre-T3 and post-T3 networks at the same time, branch on network version or activation timestamp. The old authorization ABI only works before T3. The new authorization ABI only works post-T3.
-T3 also adds one new execution restriction: access-key-signed transactions can no longer create contracts. If your product used access keys for deployments, factory calls, or module-install flows that create contracts, those transactions must move to a Root Key path.
+### Breaking changes for explorers and indexers
-If you support both pre-T3 and post-T3 networks at the same time, branch on network version or activation timestamp. The old authorization ABI only works before T3. The new authorization ABI only works after T3.
+TIP-20 virtual-address forwarding does not introduce a new transfer event. Forwarded deposits show up as two standard `Transfer` events in the same transaction: one hop into the virtual address and one hop from the virtual address to the registered master wallet.
+
+If your explorer or indexer treats each `Transfer` log as an independent user-facing transfer, forwarded deposits will appear twice: once to the virtual address and once to the master wallet. That inflates transfer counts, shows the wrong effective recipient in transfer/history views, and can mis-credit deposits to the literal virtual address instead of the registered master wallet.
+
+Handle these flows as one logical deposit to the master wallet, using the virtual address only as an attribution alias. Virtual addresses themselves always have a TIP-20 balance of zero.
### Migration checklist
-- upgrade to a T3-compatible SDK mentioned below
+- upgrade to a T3-compatible SDK release listed below
- regenerate contract bindings or replace handcrafted encoders for `authorizeKey(...)`
- move any access-key contract-creation flows to a Root Key path
-- test key creation, key rotation, and recovery flows on Moderato after T3 activates
+- if you adopt virtual addresses, collapse the two-hop `Transfer` pair into one logical deposit to the registered master wallet rather than treating the virtual address hop as a separate transfer
+- test key creation, key rotation, and recovery flows on Moderato post-T3 activation
## Compatible SDK releases
@@ -74,19 +89,23 @@ Tempo's broader tooling ecosystem is available in [Developer tools](/quickstart/
| [Python](https://github.com/tempoxyz/pytempo) | [`0.5.0`](https://github.com/tempoxyz/pytempo/releases/tag/pytempo%400.5.0) |
| [Foundry](https://github.com/tempoxyz/tempo-foundry) | [`v1.6.0-t3`](https://github.com/tempoxyz/tempo-foundry/releases/tag/v1.6.0-t3) |
+:::note[Current SDK caveat]
+The Accounts SDK and `wallet_authorizeAccessKey` docs still describe the legacy pre-T3 access-key shape. Until their T3 support lands, use the protocol specs and the T3-compatible SDK releases above for the post-T3 `authorizeKey(...)` ABI.
+:::
+
## Related docs
-Guides about TIPs coming soon.
+For the coordinating meta TIP, see [tempoxyz/tempo#3273](https://github.com/tempoxyz/tempo/pull/3273).
## Feature TIPs
### TIP-1011: Enhanced Access Key Permissions
-[TIP-1011](/protocol/tips/tip-1011) adds periodic spending limits and call scoping to access keys, including restrictions on which contracts a key can call and, for common token flows, which recipient it can target. This gives wallets, account SDKs, and apps a safer way to offer delegated permissions for recurring billing, subscription renewals, payroll, connected-app approvals, or agent budgets without asking the user to approve every transaction manually. For existing partners, previously authorized access keys continue to work after activation, but any flow that creates, rotates, or re-authorizes a key must move to the new TIP-1011 ABI, and access-key transactions can no longer be used for contract creation.
+[TIP-1011](/protocol/tips/tip-1011) adds periodic spending limits and call scoping to access keys, including restrictions on which contracts a key can call and, for common token flows, which recipient it can target. Previously authorized access keys continue to work, but any flow that creates, rotates, or re-authorizes a key must move to the new TIP-1011 ABI, and access-key transactions can no longer be used for contract creation.
### TIP-1020: Signature Verification Precompile
-[TIP-1020](/protocol/tips/tip-1020) adds a single precompile for verifying secp256k1, P256, and WebAuthn signatures onchain. This gives smart contract teams, wallet builders, and account integrators a standard verification surface for passkey wallets, multisigs, governance approvals, subscription authorization, and other signature-driven flows without deploying and maintaining custom verifier contracts for each signature type. This change is additive for existing partners: nothing breaks if you keep your current verifier setup, but teams that want simpler integrations or forward-compatible support for Tempo signature types can adopt the precompile. Keychain signatures still need `AccountKeychain` for key resolution, so this precompile covers the underlying signature schemes rather than the full keychain authorization flow.
+[TIP-1020](/protocol/tips/tip-1020) adds a single precompile for verifying secp256k1, P256, and WebAuthn signatures onchain. This is additive: existing verifier setups keep working, but teams that want a standard verification surface for passkey wallets, multisigs, governance approvals, and other signature-driven flows can adopt the precompile instead of maintaining custom verifier contracts.
### TIP-1022: Virtual Addresses for TIP-20 Deposit Forwarding
-[TIP-1022](/protocol/tips/tip-1022) lets partners issue per-user deposit addresses that forward TIP-20 deposits to a registered master wallet at the protocol level. This is useful for exchanges, ramps, custodians, and payment processors that want one deposit address per customer for reconciliation, attribution, or account crediting, but do not want to maintain sweep jobs or fund separate onchain wallets for every user. For existing partners, nothing changes unless you adopt virtual addresses, but any explorer, indexer, or backend system that surfaces TIP-20 deposit activity should handle forwarded deposits correctly. Teams that adopt virtual addresses should treat those forwarded deposits as deposits to the registered master wallet. Forwarding applies only to TIP-20 transfer paths.
+[TIP-1022](/protocol/tips/tip-1022) lets partners issue per-user deposit addresses that forward TIP-20 deposits to a registered master wallet at the protocol level. Nothing changes unless you adopt virtual addresses, but explorers, indexers, and backends that surface TIP-20 deposit activity should collapse the two-hop forwarding path into one logical deposit to the master wallet. Forwarding applies to recipient-bearing TIP-20 paths, including transfers and mints.
diff --git a/src/pages/quickstart/integrate-tempo.mdx b/src/pages/quickstart/integrate-tempo.mdx
index 9db9ca8b..4cba2811 100644
--- a/src/pages/quickstart/integrate-tempo.mdx
+++ b/src/pages/quickstart/integrate-tempo.mdx
@@ -5,7 +5,6 @@ interactive: true
import * as Demo from '../../components/guides/Demo.tsx'
import { ConnectWallet } from '../../components/ConnectWallet.tsx'
-import TempoTxProperties from '../../snippets/tempo-tx-properties.mdx'
import { Cards, Card } from 'vocs'
# Integrate Tempo
diff --git a/src/pages/quickstart/predeployed-contracts.mdx b/src/pages/quickstart/predeployed-contracts.mdx
index f16094ea..15a2e34b 100644
--- a/src/pages/quickstart/predeployed-contracts.mdx
+++ b/src/pages/quickstart/predeployed-contracts.mdx
@@ -14,6 +14,8 @@ Core protocol contracts that power Tempo's features.
| [**Fee Manager**](/protocol/fees/spec-fee-amm#2-feemanager-contract) | [`0xfeec000000000000000000000000000000000000`](https://explore.tempo.xyz/address/0xfeec000000000000000000000000000000000000) | Handle fee payments and conversions |
| [**Stablecoin DEX**](/protocol/exchange) | [`0xdec0000000000000000000000000000000000000`](https://explore.tempo.xyz/address/0xdec0000000000000000000000000000000000000) | Enshrined DEX for stablecoin swaps |
| [**TIP-403 Registry**](/protocol/tip403/spec) | [`0x403c000000000000000000000000000000000000`](https://explore.tempo.xyz/address/0x403c000000000000000000000000000000000000) | Transfer policy registry |
+| [**Signature Verifier**](/protocol/tips/tip-1020) | [`0x5165300000000000000000000000000000000000`](https://explore.tempo.xyz/address/0x5165300000000000000000000000000000000000) | Verify secp256k1, P256, and WebAuthn signatures onchain |
+| [**Address Registry**](/protocol/tips/tip-1022) | [`0xFDC0000000000000000000000000000000000000`](https://explore.tempo.xyz/address/0xFDC0000000000000000000000000000000000000) | Resolve virtual TIP-20 deposit addresses to registered master wallets |
| [**pathUSD**](/protocol/exchange/quote-tokens#pathusd) | [`0x20c0000000000000000000000000000000000000`](https://explore.tempo.xyz/address/0x20c0000000000000000000000000000000000000) | First stablecoin deployed |
## Standard Utilities
diff --git a/src/pages/sdk/foundry/index.mdx b/src/pages/sdk/foundry/index.mdx
index 73cb2e99..8390b9f4 100644
--- a/src/pages/sdk/foundry/index.mdx
+++ b/src/pages/sdk/foundry/index.mdx
@@ -14,7 +14,7 @@ For general information about Foundry, see the [Foundry documentation](https://g
Tempo's Foundry fork is installed through the standard upstream `foundryup` using the `-n tempo` flag, no separate installer is required.
-::::steps
+:::::steps
## Install `foundryup`
@@ -67,7 +67,7 @@ forge init -n tempo my-project && cd my-project
Each new project is configured for Tempo out of the box, with [`tempo-std`](https://github.com/tempoxyz/tempo-std), the Tempo standard library installed, containing helpers for Tempo's protocol-level features.
-::::
+:::::
## Use Foundry for your workflows
@@ -90,7 +90,7 @@ forge script script/Mail.s.sol
```bash
# Set environment variables
-export TEMPO_RPC_URL=https://rpc.tempo.xyz
+export TEMPO_RPC_URL=https://rpc.moderato.tempo.xyz
export VERIFIER_URL=https://contracts.tempo.xyz
# Optional: create a new keypair and request some testnet tokens from the faucet.
@@ -117,15 +117,6 @@ forge create src/Mail.sol:Mail \
--verify \
--constructor-args 0x20c0000000000000000000000000000000000001
-# Deploy using an access key (delegated signing)
-forge create src/Mail.sol:Mail \
- --tempo.access-key $ACCESS_KEY_PRIVATE_KEY \
- --tempo.root-account $ROOT_ADDRESS \
- --rpc-url $TEMPO_RPC_URL \
- --broadcast \
- --verify \
- --constructor-args 0x20c0000000000000000000000000000000000001
-
# Set a salt for deterministic contract address derivation
# The salt is passed to TIP20_FACTORY.createToken() which uses it with the sender
# address to compute a deterministic deployment address via getTokenAddress(sender, salt)
@@ -157,6 +148,8 @@ forge script script/Deploy.s.sol \
--private-key $PRIVATE_KEY
```
+Use a root key for `forge create`. Post-T3, access keys can sign calls but not deployments.
+
For more verification options including verifying existing contracts and API verification, see [Contract Verification](/quickstart/verify-contracts).
:::warning[Batch Transaction Rules]
@@ -246,8 +239,8 @@ cast send 'increment()' \
# Send with access key (delegated signing):
# First authorize the key via Account Keychain precompile
cast send 0xAAAAAAAA00000000000000000000000000000000 \
- 'authorizeKey(address,uint8,uint64,bool,(address,uint256)[])' \
- $ACCESS_KEY_ADDR 0 1893456000 false "[]" \
+ 'authorizeKey(address,uint8,uint64,bool,(address,uint256,uint64)[],bool,(address,(bytes4,address[])[])[])' \
+ $ACCESS_KEY_ADDR 0 1893456000 false "[]" true "[]" \
--rpc-url $TEMPO_RPC_URL \
--private-key $ROOT_PRIVATE_KEY
# Then send using the access key
@@ -257,6 +250,10 @@ cast send 'increment()' \
--tempo.root-account $ROOT_ADDRESS
```
+Post-T3, direct `authorizeKey(...)` calls must use the enhanced TIP-1011 ABI shown above. If you need periodic limits or call scopes, fill those arrays instead of passing `[]`.
+
+Post-T3, access-key transactions also cannot create contracts, so use a root key for deployments or other flows that perform `CREATE`.
+
### Local Development with Anvil
Anvil supports Tempo mode for local testing and forking Tempo networks:
@@ -385,4 +382,3 @@ cast keychain key-info \
cast keychain remaining-limit \
--rpc-url $TEMPO_RPC_URL
```
-
diff --git a/src/pages/sdk/typescript/index.mdx b/src/pages/sdk/typescript/index.mdx
index 8fdf9a16..9a16325a 100644
--- a/src/pages/sdk/typescript/index.mdx
+++ b/src/pages/sdk/typescript/index.mdx
@@ -6,13 +6,11 @@ import { Cards, Card } from 'vocs'
# TypeScript SDKs
-
Tempo distributes TypeScript SDKs for:
- [Viem](https://viem.sh): TypeScript interface for EVM blockchains
- [Wagmi](https://wagmi.sh): React Hooks (and reactive primitives) for EVM blockchains
-The Tempo extensions can be used to perform common operations with the chain, such as:
- querying the chain, sending Tempo transactions, managing tokens & their AMM pools, and more.
+The Tempo extensions cover common chain operations such as querying state, sending Tempo transactions, and managing tokens and AMM pools.
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { client } from './viem.config'
+
+ const alphaUsd = '0x20c0000000000000000000000000000000000001'
+
+ const receipt = await client.sendTransactionSync({
+ data: '0xdeadbeef',
+ feeToken: alphaUsd, // [!code hl]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ })
+ ```
+
+ ```tsx twoslash [viem.config.ts]
+ // [!include ~/snippets/viem.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { useSendTransactionSync } from 'wagmi'
+
+ const { sendTransactionSync } = useSendTransactionSync()
+
+ const alphaUsd = '0x20c0000000000000000000000000000000000001'
+
+ sendTransactionSync({
+ data: '0xdeadbeef',
+ feeToken: alphaUsd, // [!code hl]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ })
+ ```
+
+ ```tsx twoslash [wagmi.config.ts]
+ // @noErrors
+ // [!include ~/snippets/wagmi.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```rust [example.rs]
+ use alloy::primitives::{address, bytes};
+ use alloy::providers::Provider;
+ use tempo_alloy::rpc::TempoTransactionRequest;
+
+ mod provider;
+
+ #[tokio::main]
+ async fn main() -> Result<(), Box> {
+ let provider = provider::get_provider().await?;
+
+ let alpha_usd = address!("0x20c0000000000000000000000000000000000001");
+
+ let pending = provider
+ .send_transaction(
+ TempoTransactionRequest::default()
+ .with_fee_token(alpha_usd) // [!code hl]
+ .with_to(address!("0xcafebabecafebabecafebabecafebabecafebabe"))
+ .with_input(bytes!("deadbeef")),
+ )
+ .await?;
+
+ Ok(())
+ }
+ ```
+
+ ```rust [provider.rs]
+ // [!include ~/snippets/rust-signer-provider.rs:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```python [example.py]
+ from pytempo import Call, TempoTransaction
+ from provider import w3, account
+
+ alpha_usd = "0x20c0000000000000000000000000000000000001"
+
+ tx = TempoTransaction.create(
+ chain_id=w3.eth.chain_id,
+ gas_limit=300_000,
+ max_fee_per_gas=w3.eth.gas_price * 2,
+ max_priority_fee_per_gas=w3.eth.gas_price,
+ nonce=w3.eth.get_transaction_count(account.address),
+ fee_token=alpha_usd, # [!code hl]
+ calls=(
+ Call.create(
+ to="0xcafebabecafebabecafebabecafebabecafebabe",
+ data="0xdeadbeef",
+ ),
+ ),
+ )
+
+ signed_tx = tx.sign(account.key.hex())
+ tx_hash = w3.eth.send_raw_transaction(signed_tx.encode())
+ ```
+
+ ```python [provider.py]
+ from web3 import Web3
+ from eth_account import Account
+
+ w3 = Web3(Web3.HTTPProvider("https://rpc.tempo.xyz"))
+ account = Account.from_key("0x...")
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```go [main.go]
+ package main
+
+ import (
+ "context"
+ "log"
+ "math/big"
+
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/tempoxyz/tempo-go/pkg/signer"
+ "github.com/tempoxyz/tempo-go/pkg/transaction"
+ )
+
+ func main() {
+ sgn, _ := signer.NewSigner("0x...")
+ c := newClient()
+ ctx := context.Background()
+
+ nonce, _ := c.GetTransactionCount(ctx, sgn.Address().Hex())
+
+ tx := transaction.NewBuilder(big.NewInt(transaction.ChainIdMainnet)).
+ SetNonce(nonce).
+ SetGas(300_000).
+ SetMaxFeePerGas(big.NewInt(25_000_000_000)).
+ SetMaxPriorityFeePerGas(big.NewInt(1_000_000_000)).
+ SetFeeToken(transaction.AlphaUSDAddress). // [!code hl]
+ AddCall(
+ common.HexToAddress("0xcafebabecafebabecafebabecafebabecafebabe"),
+ big.NewInt(0),
+ common.Hex2Bytes("deadbeef"),
+ ).
+ Build()
+
+ _ = transaction.SignTransaction(tx, sgn)
+ serialized, _ := transaction.Serialize(tx, nil)
+ txHash, _ := c.SendRawTransaction(ctx, serialized)
+
+ log.Printf("Transaction hash: %s", txHash)
+ }
+ ```
+
+ ```go [provider.go]
+ // [!include ~/snippets/go-provider.go:setup]
+ ```
+
+ :::
+
+
+
+
+
+ ```bash
+ $ cast send 0xcafebabecafebabecafebabecafebabecafebabe \
+ --data 0xdeadbeef \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $PRIVATE_KEY \
+ --tempo.fee-token 0x20c0000000000000000000000000000000000001 # [!code hl]
+ ```
+
+
+
+
+
+ ```tsx
+ rlp([
+ chain_id,
+ max_priority_fee_per_gas,
+ max_fee_per_gas,
+ gas,
+ calls,
+ access_list,
+ nonce_key,
+ nonce,
+ valid_before,
+ valid_after,
+ fee_token, // [!code focus]
+ fee_payer_signature,
+ aa_authorization_list,
+ key_authorization,
+ signature,
+ ])
+ ```
+
+
+
+
+:::info
+See a full guide on [paying fees in any stablecoin](/guide/payments/pay-fees-in-any-stablecoin).
+:::
+
+### Fee Sponsorship
+
+Fee sponsorship enables a third party (the fee payer) to pay transaction fees on behalf of the transaction sender.
+
+The process uses dual signature domains: the sender signs their transaction, and then the fee payer signs
+over the transaction with a special "fee payer envelope" to commit to paying fees for that specific sender.
+
+
+
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { client } from './viem.config'
+
+ const feePayer = privateKeyToAccount('0x...')
+
+ const receipt = await client.sendTransactionSync({
+ data: '0xdeadbeef',
+ feePayer, // [!code hl]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ })
+ ```
+
+ ```tsx twoslash [viem.config.ts]
+ // [!include ~/snippets/viem.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { useSendTransactionSync } from 'wagmi'
+
+ export const feePayer = privateKeyToAccount('0x...')
+
+ const { sendTransactionSync } = useSendTransactionSync()
+
+ sendTransactionSync({
+ data: '0xdeadbeef',
+ feePayer, // [!code hl]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ })
+ ```
+
+ ```tsx twoslash [wagmi.config.ts]
+ // @noErrors
+ // [!include ~/snippets/wagmi.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```rust [example.rs]
+ use alloy::primitives::{U256, address, bytes};
+ use alloy::providers::Provider;
+ use alloy::signers::{SignerSync, local::PrivateKeySigner};
+ use tempo_alloy::primitives::transaction::tempo_transaction::Call;
+ use tempo_alloy::rpc::TempoTransactionRequest;
+
+ mod provider;
+
+ #[tokio::main]
+ async fn main() -> Result<(), Box> {
+ let provider = provider::get_provider().await?;
+
+ let tx = TempoTransactionRequest {
+ calls: vec![Call {
+ to: address!("0xcafebabecafebabecafebabecafebabecafebabe").into(),
+ value: U256::ZERO,
+ input: bytes!("deadbeef"),
+ }],
+ ..Default::default()
+ };
+
+ // Step 1: Build the transaction
+ let mut tempo_tx = provider.fill(tx).await?.build_aa()?;
+ let sender_addr = provider.default_signer_address();
+ let fee_payer_hash = tempo_tx.fee_payer_signature_hash(sender_addr);
+
+ // Step 2: Fee payer counter-signs the transaction // [!code hl]
+ let fee_payer: PrivateKeySigner = "0x...".parse()?; // [!code hl]
+ tempo_tx.fee_payer_signature = Some(fee_payer.sign_hash_sync(&fee_payer_hash)?); // [!code hl]
+
+ // Step 3: Broadcast
+ let pending = provider.send_transaction(tempo_tx).await?;
+
+ Ok(())
+ }
+ ```
+
+ ```rust [provider.rs]
+ // [!include ~/snippets/rust-signer-provider.rs:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```python [example.py]
+ from pytempo import Call, TempoTransaction
+ from provider import w3, account
+
+ fee_payer_key = "0x..."
+
+ # Sender signs with awaiting_fee_payer flag
+ tx = TempoTransaction.create(
+ chain_id=w3.eth.chain_id,
+ gas_limit=300_000,
+ max_fee_per_gas=w3.eth.gas_price * 2,
+ max_priority_fee_per_gas=w3.eth.gas_price,
+ nonce=w3.eth.get_transaction_count(account.address),
+ awaiting_fee_payer=True, # [!code hl]
+ calls=(
+ Call.create(
+ to="0xcafebabecafebabecafebabecafebabecafebabe",
+ data="0xdeadbeef",
+ ),
+ ),
+ )
+ sender_signed = tx.sign(account.key.hex())
+
+ # Fee payer co-signs the transaction // [!code hl]
+ fully_signed = sender_signed.sign(fee_payer_key, for_fee_payer=True) # [!code hl]
+
+ tx_hash = w3.eth.send_raw_transaction(fully_signed.encode())
+ ```
+
+ ```python [provider.py]
+ from web3 import Web3
+ from eth_account import Account
+
+ w3 = Web3(Web3.HTTPProvider("https://rpc.tempo.xyz"))
+ account = Account.from_key("0x...")
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```go [main.go]
+ package main
+
+ import (
+ "context"
+ "log"
+ "math/big"
+
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/tempoxyz/tempo-go/pkg/signer"
+ "github.com/tempoxyz/tempo-go/pkg/transaction"
+ )
+
+ func main() {
+ senderSgn, _ := signer.NewSigner("0x...")
+ sponsorSgn, _ := signer.NewSigner("0x...")
+ c := newClient()
+ ctx := context.Background()
+
+ nonce, _ := c.GetTransactionCount(ctx, senderSgn.Address().Hex())
+
+ // Sender builds and signs a sponsored transaction
+ tx := transaction.NewBuilder(big.NewInt(transaction.ChainIdMainnet)).
+ SetNonce(nonce).
+ SetGas(300_000).
+ SetMaxFeePerGas(big.NewInt(25_000_000_000)).
+ SetMaxPriorityFeePerGas(big.NewInt(1_000_000_000)).
+ SetSponsored(true). // [!code hl]
+ AddCall(
+ common.HexToAddress("0xcafebabecafebabecafebabecafebabecafebabe"),
+ big.NewInt(0),
+ common.Hex2Bytes("deadbeef"),
+ ).
+ Build()
+
+ _ = transaction.SignTransaction(tx, senderSgn)
+
+ // Fee payer co-signs the transaction // [!code hl]
+ tx.FeeToken = transaction.AlphaUSDAddress // [!code hl]
+ tx.AwaitingFeePayer = false // [!code hl]
+ _ = transaction.AddFeePayerSignature(tx, sponsorSgn) // [!code hl]
+
+ serialized, _ := transaction.Serialize(tx, nil)
+ txHash, _ := c.SendRawTransaction(ctx, serialized)
+
+ log.Printf("Transaction hash: %s", txHash)
+ }
+ ```
+
+ ```go [provider.go]
+ // [!include ~/snippets/go-provider.go:setup]
+ ```
+
+ :::
+
+
+
+
+
+ ```bash
+ # 1. Get the fee payer signature hash
+ $ FEE_PAYER_HASH=$(cast mktx 0xcafebabecafebabecafebabecafebabecafebabe \
+ --data 0xdeadbeef \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $SENDER_KEY \
+ --tempo.print-sponsor-hash) # [!code hl]
+
+ # 2. Sponsor signs the hash
+ $ SPONSOR_SIG=$(cast wallet sign \
+ --private-key $SPONSOR_KEY \
+ "$FEE_PAYER_HASH" \
+ --no-hash) # [!code hl]
+
+ # 3. Send with sponsor signature
+ $ cast send 0xcafebabecafebabecafebabecafebabecafebabe \
+ --data 0xdeadbeef \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $SENDER_KEY \
+ --tempo.sponsor-signature "$SPONSOR_SIG" # [!code hl]
+ ```
+
+
+
+
+
+ ```tsx
+ // 1. User signs over `user_envelope` // [!code focus]
+ user_envelope = 0x77 ∥ rlp([
+ chain_id,
+ max_priority_fee_per_gas,
+ max_fee_per_gas,
+ gas,
+ calls,
+ access_list,
+ nonce_key,
+ nonce,
+ valid_before,
+ valid_after,
+ fee_token,
+ 0x00, // indicate intention for a fee payer // [!code focus]
+ aa_authorization_list,
+ key_authorization
+ ])
+
+ // 2. Fee payer signs over `fee_payer_envelope` // [!code focus]
+ fee_payer_envelope = 0x76 ∥ rlp([
+ chain_id,
+ max_priority_fee_per_gas,
+ max_fee_per_gas,
+ gas,
+ calls,
+ access_list,
+ nonce_key,
+ nonce,
+ valid_before,
+ valid_after,
+ fee_token,
+ sender_address, // scope to sender // [!code focus]
+ aa_authorization_list,
+ key_authorization
+ ])
+
+ // 3. Construct + send off `final_envelope` to the network // [!code focus]
+ final_envelope = 0x77 ∥ rlp([
+ chain_id,
+ max_priority_fee_per_gas,
+ max_fee_per_gas,
+ gas,
+ calls,
+ access_list,
+ nonce_key,
+ nonce,
+ valid_before,
+ valid_after,
+ fee_token,
+ fee_payer_signature, // signature over `fee_payer_envelope` // [!code focus]
+ aa_authorization_list,
+ key_authorization,
+ signature, // signature over `user_envelope` // [!code focus]
+ ])
+ ```
+
+
+
+:::tip
+It is also possible to use a remote [Fee Payer Relay](/guide/payments/sponsor-user-fees#fee-payer-relay) instead of a local account.
+:::
+
+
+
+:::info
+See a full guide on [sponsoring fees](/guide/payments/sponsor-user-fees).
+:::
+
+### Batch Calls
+
+Batch calls enable multiple operations to be executed atomically within a single transaction.
+Instead of sending separate transactions for each operation, you can bundle multiple calls together using the `calls`
+parameter.
+
+
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { client } from './viem.config'
+
+ const receipt = await client.sendTransactionSync({
+ calls: [ // [!code hl]
+ { // [!code hl]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe', // [!code hl]
+ data: '0xdeadbeef0000000000000000000000000000000001', // [!code hl]
+ }, // [!code hl]
+ { // [!code hl]
+ to: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef', // [!code hl]
+ data: '0xcafebabe0000000000000000000000000000000001', // [!code hl]
+ }, // [!code hl]
+ { // [!code hl]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe', // [!code hl]
+ data: '0xdeadbeef0000000000000000000000000000000001', // [!code hl]
+ }, // [!code hl]
+ ] // [!code hl]
+ })
+ ```
+
+ ```tsx twoslash [viem.config.ts]
+ // [!include ~/snippets/viem.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { useSendTransactionSync } from 'wagmi'
+
+ const { sendTransactionSync } = useSendTransactionSync()
+
+ sendTransactionSync({
+ calls: [ // [!code hl]
+ { // [!code hl]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe', // [!code hl]
+ data: '0xdeadbeef0000000000000000000000000000000001', // [!code hl]
+ }, // [!code hl]
+ { // [!code hl]
+ to: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef', // [!code hl]
+ data: '0xcafebabe0000000000000000000000000000000001', // [!code hl]
+ }, // [!code hl]
+ { // [!code hl]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe', // [!code hl]
+ data: '0xdeadbeef0000000000000000000000000000000001', // [!code hl]
+ }, // [!code hl]
+ ] // [!code hl]
+ })
+ ```
+
+ ```tsx twoslash [wagmi.config.ts]
+ // @noErrors
+ // [!include ~/snippets/wagmi.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```rust [example.rs]
+ use alloy::primitives::{U256, address, bytes};
+ use alloy::providers::Provider;
+ use tempo_alloy::primitives::transaction::Call;
+ use tempo_alloy::rpc::TempoTransactionRequest;
+
+ mod provider;
+
+ #[tokio::main]
+ async fn main() -> Result<(), Box> {
+ let provider = provider::get_provider().await?;
+
+ let pending = provider
+ .send_transaction(TempoTransactionRequest {
+ calls: vec![ // [!code hl]
+ Call { // [!code hl]
+ to: address!("0xcafebabecafebabecafebabecafebabecafebabe").into(), // [!code hl]
+ value: U256::ZERO, // [!code hl]
+ input: bytes!("deadbeef0000000000000000000000000000000001"), // [!code hl]
+ }, // [!code hl]
+ Call { // [!code hl]
+ to: address!("0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef").into(), // [!code hl]
+ value: U256::ZERO, // [!code hl]
+ input: bytes!("cafebabe0000000000000000000000000000000001"), // [!code hl]
+ }, // [!code hl]
+ Call { // [!code hl]
+ to: address!("0xcafebabecafebabecafebabecafebabecafebabe").into(), // [!code hl]
+ value: U256::ZERO, // [!code hl]
+ input: bytes!("deadbeef0000000000000000000000000000000001"), // [!code hl]
+ }, // [!code hl]
+ ], // [!code hl]
+ ..Default::default()
+ })
+ .await?;
+
+ Ok(())
+ }
+ ```
+
+ ```rust [provider.rs]
+ // [!include ~/snippets/rust-signer-provider.rs:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```python [example.py]
+ from pytempo import Call, TempoTransaction
+ from provider import w3, account
+
+ tx = TempoTransaction.create(
+ chain_id=w3.eth.chain_id,
+ gas_limit=600_000,
+ max_fee_per_gas=w3.eth.gas_price * 2,
+ max_priority_fee_per_gas=w3.eth.gas_price,
+ nonce=w3.eth.get_transaction_count(account.address),
+ calls=( # [!code hl]
+ Call.create( # [!code hl]
+ to="0xcafebabecafebabecafebabecafebabecafebabe", # [!code hl]
+ data="0xdeadbeef0000000000000000000000000000000001", # [!code hl]
+ ), # [!code hl]
+ Call.create( # [!code hl]
+ to="0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", # [!code hl]
+ data="0xcafebabe0000000000000000000000000000000001", # [!code hl]
+ ), # [!code hl]
+ Call.create( # [!code hl]
+ to="0xcafebabecafebabecafebabecafebabecafebabe", # [!code hl]
+ data="0xdeadbeef0000000000000000000000000000000001", # [!code hl]
+ ), # [!code hl]
+ ), # [!code hl]
+ )
+
+ signed_tx = tx.sign(account.key.hex())
+ tx_hash = w3.eth.send_raw_transaction(signed_tx.encode())
+ ```
+
+ ```python [provider.py]
+ from web3 import Web3
+ from eth_account import Account
+
+ w3 = Web3(Web3.HTTPProvider("https://rpc.tempo.xyz"))
+ account = Account.from_key("0x...")
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```go [main.go]
+ package main
+
+ import (
+ "context"
+ "log"
+ "math/big"
+
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/tempoxyz/tempo-go/pkg/signer"
+ "github.com/tempoxyz/tempo-go/pkg/transaction"
+ )
+
+ func main() {
+ sgn, _ := signer.NewSigner("0x...")
+ c := newClient()
+ ctx := context.Background()
+
+ nonce, _ := c.GetTransactionCount(ctx, sgn.Address().Hex())
+
+ tx := transaction.NewBuilder(big.NewInt(transaction.ChainIdMainnet)).
+ SetNonce(nonce).
+ SetGas(600_000).
+ SetMaxFeePerGas(big.NewInt(25_000_000_000)).
+ SetMaxPriorityFeePerGas(big.NewInt(1_000_000_000)).
+ AddCall( // [!code hl]
+ common.HexToAddress("0xcafebabecafebabecafebabecafebabecafebabe"), // [!code hl]
+ big.NewInt(0), // [!code hl]
+ common.Hex2Bytes("deadbeef0000000000000000000000000000000001"), // [!code hl]
+ ). // [!code hl]
+ AddCall( // [!code hl]
+ common.HexToAddress("0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"), // [!code hl]
+ big.NewInt(0), // [!code hl]
+ common.Hex2Bytes("cafebabe0000000000000000000000000000000001"), // [!code hl]
+ ). // [!code hl]
+ AddCall( // [!code hl]
+ common.HexToAddress("0xcafebabecafebabecafebabecafebabecafebabe"), // [!code hl]
+ big.NewInt(0), // [!code hl]
+ common.Hex2Bytes("deadbeef0000000000000000000000000000000001"), // [!code hl]
+ ). // [!code hl]
+ Build()
+
+ _ = transaction.SignTransaction(tx, sgn)
+ serialized, _ := transaction.Serialize(tx, nil)
+ txHash, _ := c.SendRawTransaction(ctx, serialized)
+
+ log.Printf("Transaction hash: %s", txHash)
+ }
+ ```
+
+ ```go [provider.go]
+ // [!include ~/snippets/go-provider.go:setup]
+ ```
+
+ :::
+
+
+
+
+
+ ```bash
+ $ cast batch-send \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $PRIVATE_KEY \
+ --call "0xcafebabecafebabecafebabecafebabecafebabe::increment()" \
+ --call "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef::setNumber(uint256):500" \
+ --call "0xcafebabecafebabecafebabecafebabecafebabe::increment()"
+ ```
+
+
+
+
+
+ ```tsx
+ rlp([
+ chain_id,
+ max_priority_fee_per_gas,
+ max_fee_per_gas,
+ gas,
+ calls, // [!code focus]
+ access_list,
+ nonce_key,
+ nonce,
+ valid_before,
+ valid_after,
+ fee_token,
+ fee_payer_signature,
+ aa_authorization_list,
+ key_authorization,
+ signature,
+ ])
+ ```
+
+
+
+### Access Keys
+
+Access keys enable you to delegate signing authority from a primary account to a secondary key,
+such as device-bound non-extractable [WebCrypto key](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKeyPair). The primary account signs a key authorization that grants the access key permission
+to sign transactions on its behalf.
+
+This authorization is then attached to the next transaction (that can be signed by either the primary or the access key), then all
+transactions thereafter can be signed by the access key.
+
+Post-T3, access keys can sign calls but not contract deployments or other transactions that perform `CREATE` or `CREATE2`.
+
+
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { Account, WebCryptoP256 } from 'viem/tempo'
+ import { client } from './viem.config'
+
+ // 1. Instantiate account.
+ const account = Account.fromSecp256k1('0x...')
+
+ // 2. Generate a non-extractable WebCrypto key pair & instantiate access key.
+ const keyPair = await WebCryptoP256.createKeyPair()
+ const accessKey = Account.fromWebCryptoP256(keyPair, {
+ access: account,
+ })
+
+ // 3. Sign over key authorization with account.
+ const keyAuthorization = await account.signKeyAuthorization(accessKey)
+
+ // 4. Attach key authorization to (next) transaction.
+ const receipt = await client.sendTransactionSync({
+ account: accessKey, // sign transaction with access key // [!code hl]
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ keyAuthorization, // [!code hl]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ })
+ ```
+
+ ```tsx twoslash [viem.config.ts]
+ // [!include ~/snippets/viem.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { tempo } from 'viem/chains'
+ import { KeyManager, webAuthn } from 'wagmi/tempo'
+ import { createConfig, http } from 'wagmi'
+
+ export const config = createConfig({
+ connectors: [
+ webAuthn({
+ grantAccessKey: true, // [!code hl]
+ keyManager: KeyManager.localStorage(),
+ }),
+ ],
+ chains: [tempo],
+ multiInjectedProviderDiscovery: false,
+ transports: {
+ [tempo.id]: http(),
+ },
+ })
+ ```
+
+
+
+
+
+ :::code-group
+
+ ```rust [example.rs]
+ use alloy::primitives::{address, bytes};
+ use alloy::providers::Provider;
+ use alloy::signers::{SignerSync, local::PrivateKeySigner};
+ use tempo_alloy::primitives::transaction::key_authorization::{
+ KeyAuthorization, SignedKeyAuthorization,
+ };
+ use tempo_alloy::primitives::transaction::tt_signature::{
+ KeychainSignature, PrimitiveSignature, SignatureType, TempoSignature,
+ };
+ use tempo_alloy::rpc::TempoTransactionRequest;
+
+ mod provider;
+
+ #[tokio::main]
+ async fn main() -> Result<(), Box> {
+ let provider = provider::get_provider().await?;
+
+ let root = PrivateKeySigner::from_str("0x...")?;
+ let access_key = PrivateKeySigner::random();
+
+ // Sign key authorization with root account // [!code hl]
+ let authorization = KeyAuthorization { // [!code hl]
+ chain_id: 4217, // [!code hl]
+ key_type: SignatureType::Secp256k1, // [!code hl]
+ key_id: access_key.address(), // [!code hl]
+ expiry: None, // [!code hl]
+ limits: None, // [!code hl]
+ allowed_calls: None, // [!code hl]
+ }; // [!code hl]
+ let sig = root.sign_hash_sync(&authorization.signature_hash())?; // [!code hl]
+ let key_authorization = SignedKeyAuthorization { // [!code hl]
+ authorization, // [!code hl]
+ signature: sig.into(), // [!code hl]
+ }; // [!code hl]
+
+ // Attach key authorization to a transaction signed by the root key. // [!code hl]
+ // This registers the access key on-chain via the Account Keychain. // [!code hl]
+ provider
+ .send_transaction(
+ TempoTransactionRequest {
+ key_authorization: Some(key_authorization), // [!code hl]
+ ..Default::default()
+ }
+ .with_to(address!("0xcafebabecafebabecafebabecafebabecafebabe"))
+ .with_input(bytes!("deadbeef")),
+ )
+ .await?
+ .get_receipt()
+ .await?;
+
+ // Sign a subsequent transaction with the access key // [!code hl]
+ let tx = TempoTransactionRequest::default()
+ .with_to(address!("0xcafebabecafebabecafebabecafebabecafebabe"))
+ .with_input(bytes!("deadbeef"));
+
+ let filled = provider.fill(tx).await?;
+ let tempo_tx = filled.build_aa()?;
+
+ // Access key signs a domain-separated hash bound to the root account // [!code hl]
+ let inner_hash = // [!code hl]
+ KeychainSignature::signing_hash(tempo_tx.signature_hash(), root.address()); // [!code hl]
+ let inner_sig = access_key.sign_hash_sync(&inner_hash)?; // [!code hl]
+ let signature = TempoSignature::Keychain(KeychainSignature::new( // [!code hl]
+ root.address(), // [!code hl]
+ PrimitiveSignature::Secp256k1(inner_sig), // [!code hl]
+ )); // [!code hl]
+
+ let envelope = tempo_tx.into_signed(signature); // [!code hl]
+ let pending = provider // [!code hl]
+ .send_raw_transaction(envelope.encoded_2718().as_ref()) // [!code hl]
+ .await?; // [!code hl]
+
+ Ok(())
+ }
+ ```
+
+ ```rust [provider.rs]
+ // [!include ~/snippets/rust-signer-provider.rs:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```python [example.py]
+ import time
+
+ from eth_account import Account as EthAccount
+ from pytempo import (
+ Call, KeyAuthorization, SignatureType, TempoTransaction,
+ sign_tx_access_key,
+ )
+ from provider import w3, account
+
+ access_key = EthAccount.create()
+
+ # Sign key authorization with root account // [!code hl]
+ auth = KeyAuthorization( # [!code hl]
+ chain_id=w3.eth.chain_id, # [!code hl]
+ key_type=SignatureType.SECP256K1, # [!code hl]
+ key_id=access_key.address, # [!code hl]
+ expiry=int(time.time()) + 3600, # [!code hl]
+ limits=None, # [!code hl]
+ allowed_calls=None, # [!code hl]
+ ) # [!code hl]
+ signed_auth = auth.sign(account.key.hex()) # [!code hl]
+
+ # Attach key authorization to a transaction signed by the access key. // [!code hl]
+ # This registers the access key on-chain via the Account Keychain. // [!code hl]
+ tx = TempoTransaction.create(
+ chain_id=w3.eth.chain_id,
+ gas_limit=600_000,
+ max_fee_per_gas=w3.eth.gas_price * 2,
+ max_priority_fee_per_gas=w3.eth.gas_price,
+ nonce=0,
+ nonce_key=201,
+ key_authorization=signed_auth.rlp_encode(), # [!code hl]
+ calls=(
+ Call.create(
+ to="0xcafebabecafebabecafebabecafebabecafebabe",
+ data="0xdeadbeef",
+ ),
+ ),
+ )
+
+ signed_tx = sign_tx_access_key( # [!code hl]
+ tx, # [!code hl]
+ access_key_private_key=access_key.key.hex(), # [!code hl]
+ root_account=account.address, # [!code hl]
+ ) # [!code hl]
+ tx_hash = w3.eth.send_raw_transaction(signed_tx.encode())
+ ```
+
+ ```python [provider.py]
+ from web3 import Web3
+ from eth_account import Account
+
+ w3 = Web3(Web3.HTTPProvider("https://rpc.tempo.xyz"))
+ account = Account.from_key("0x...")
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```go [main.go]
+ package main
+
+ import (
+ "context"
+ "encoding/hex"
+ "log"
+ "math/big"
+ "strings"
+
+ "github.com/ethereum/go-ethereum/accounts/abi"
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/core/types"
+ "github.com/ethereum/go-ethereum/crypto"
+ "github.com/tempoxyz/tempo-go/pkg/keychain"
+ "github.com/tempoxyz/tempo-go/pkg/signer"
+ "github.com/tempoxyz/tempo-go/pkg/transaction"
+ )
+
+ func main() {
+ rootSgn, _ := signer.NewSigner("0x...")
+ accessKeyPriv, _ := crypto.GenerateKey()
+ accessKey := signer.NewSignerFromKey(accessKeyPriv)
+ c := newClient()
+ ctx := context.Background()
+
+ chainID := big.NewInt(transaction.ChainIdMainnet)
+ gasPrice := big.NewInt(25_000_000_000)
+ keychainAddr := common.HexToAddress(keychain.AccountKeychainAddress)
+
+ // Authorize the access key via Account Keychain precompile // [!code hl]
+ parsed, _ := abi.JSON(strings.NewReader(`[{`
+ "name": "authorizeKey",
+ "type": "function",
+ "inputs": [
+ {"name": "keyId", "type": "address"},
+ {"name": "signatureType", "type": "uint8"},
+ {"name": "expiry", "type": "uint64"},
+ {"name": "enforceLimits", "type": "bool"},
+ {"name": "limits", "type": "tuple[]", "components": [
+ {"name": "token", "type": "address"},
+ {"name": "amount", "type": "uint256"},
+ {"name": "period", "type": "uint64"}
+ ]},
+ {"name": "allowAnyCalls", "type": "bool"},
+ {"name": "allowedCalls", "type": "tuple[]", "components": [
+ {"name": "target", "type": "address"},
+ {"name": "selectorRules", "type": "tuple[]", "components": [
+ {"name": "selector", "type": "bytes4"},
+ {"name": "recipients", "type": "address[]"}
+ ]}
+ ]}
+ ]
+ }]`))
+ type TokenLimit struct {
+ Token common.Address
+ Amount *big.Int
+ Period uint64
+ }
+ type SelectorRule struct {
+ Selector [4]byte
+ Recipients []common.Address
+ }
+ type CallScope struct {
+ Target common.Address
+ SelectorRules []SelectorRule
+ }
+ calldata, _ := parsed.Pack("authorizeKey",
+ accessKey.Address(),
+ uint8(0),
+ uint64(1893456000),
+ false,
+ []TokenLimit{},
+ true,
+ []CallScope{},
+ )
+
+ nonce, _ := c.GetTransactionCount(ctx, rootSgn.Address().Hex())
+ authTx := types.NewTx(&types.DynamicFeeTx{
+ ChainID: chainID,
+ Nonce: nonce,
+ GasTipCap: gasPrice,
+ GasFeeCap: gasPrice,
+ Gas: 600_000,
+ To: &keychainAddr,
+ Data: calldata,
+ })
+ signedAuthTx, _ := types.SignTx(
+ authTx, types.NewLondonSigner(chainID), rootSgn.PrivateKey(),
+ )
+ txBytes, _ := signedAuthTx.MarshalBinary()
+ authHash, _ := c.SendRawTransaction(ctx, "0x"+hex.EncodeToString(txBytes))
+ log.Printf("Authorized access key: %s", authHash)
+
+ // Sign a transaction with the access key // [!code hl]
+ tx := transaction.NewBuilder(chainID). // [!code hl]
+ SetNonce(0). // [!code hl]
+ SetNonceKey(big.NewInt(300)). // [!code hl]
+ SetGas(500_000). // [!code hl]
+ SetMaxFeePerGas(gasPrice). // [!code hl]
+ SetMaxPriorityFeePerGas(gasPrice). // [!code hl]
+ AddCall( // [!code hl]
+ common.HexToAddress("0xcafebabecafebabecafebabecafebabecafebabe"), // [!code hl]
+ big.NewInt(0), // [!code hl]
+ common.Hex2Bytes("deadbeef"), // [!code hl]
+ ). // [!code hl]
+ Build() // [!code hl]
+
+ _ = keychain.SignWithAccessKey(tx, accessKey, rootSgn.Address()) // [!code hl]
+
+ serialized, _ := transaction.Serialize(tx, nil)
+ txHash, _ := c.SendRawTransaction(ctx, serialized)
+
+ log.Printf("Transaction hash: %s", txHash)
+ }
+ ```
+
+ ```go [provider.go]
+ // [!include ~/snippets/go-provider.go:setup]
+ ```
+
+ :::
+
+
+
+
+
+ ```bash
+ # 1. Authorize the access key via Account Keychain precompile
+ $ cast send 0xAAAAAAAA00000000000000000000000000000000 \
+ 'authorizeKey(address,uint8,uint64,bool,(address,uint256,uint64)[],bool,(address,(bytes4,address[])[])[])' \
+ $ACCESS_KEY_ADDR 0 1893456000 false "[]" true "[]" \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $ROOT_PRIVATE_KEY # [!code hl]
+
+ # 2. Send using the access key
+ $ cast send 0xcafebabecafebabecafebabecafebabecafebabe \
+ --data 0xdeadbeef \
+ --rpc-url $TEMPO_RPC_URL \
+ --tempo.root-account $ROOT_ADDRESS \
+ --tempo.access-key $ACCESS_KEY_PRIVATE_KEY # [!code hl]
+ ```
+
+
+
+
+
+ ```tsx
+ rlp([
+ chain_id,
+ max_priority_fee_per_gas,
+ max_fee_per_gas,
+ gas,
+ calls,
+ access_list,
+ nonce_key,
+ nonce,
+ valid_before,
+ valid_after,
+ fee_token,
+ fee_payer_signature,
+ aa_authorization_list,
+ key_authorization, // [!code focus]
+ signature,
+ ])
+ ```
+
+
+
+:::info
+Learn more about [Access Keys](/protocol/transactions/spec-tempo-transaction#access-keys).
+:::
+
+### Concurrent Transactions
+
+Concurrent transactions enable higher throughput by allowing multiple transactions from the same account to be sent
+in parallel without waiting for sequential nonce confirmation.
+
+By utilizing nonce keys, you can submit multiple transactions simultaneously that don't conflict with each other,
+enabling parallel execution and significantly improved transaction throughput for high-activity accounts.
+
+Concurrent transactions can be achieved with nonce keys via:
+- [Expiring Nonces](#expiring-nonces)
+- [2D Nonces](#2d-nonces)
+
+In **Viem** and **Wagmi**, expiring nonces are handled automatically.
+
+
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { client } from './viem.config'
+
+ const [receipt1, receipt2, receipt3] = await Promise.all([
+ client.sendTransactionSync({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ }),
+ client.sendTransactionSync({
+ data: '0xcafebabe0000000000000000000000000000000001',
+ to: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
+ }),
+ client.sendTransactionSync({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ }),
+ ])
+ ```
+
+ ```tsx twoslash [viem.config.ts]
+ // [!include ~/snippets/viem.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { useSendTransaction } from 'wagmi'
+
+ const { sendTransaction } = useSendTransaction()
+
+ sendTransaction({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ })
+ sendTransaction({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ })
+ sendTransaction({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ })
+ ```
+
+ ```tsx twoslash [wagmi.config.ts]
+ // @noErrors
+ // [!include ~/snippets/wagmi.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```rust [example.rs]
+ use alloy::primitives::{U256, address, bytes};
+ use alloy::providers::Provider;
+ use tempo_alloy::rpc::TempoTransactionRequest;
+
+ mod provider;
+
+ #[tokio::main]
+ async fn main() -> Result<(), Box> {
+ let provider = provider::get_provider().await?;
+
+ // Send three transactions concurrently using different nonce keys
+ let (r1, r2, r3) = tokio::try_join!(
+ provider.send_transaction(
+ TempoTransactionRequest::default()
+ .with_nonce_key(U256::from(1)) // [!code hl]
+ .with_to(address!("0xcafebabecafebabecafebabecafebabecafebabe"))
+ .with_input(bytes!("deadbeef0000000000000000000000000000000001")),
+ ),
+ provider.send_transaction(
+ TempoTransactionRequest::default()
+ .with_nonce_key(U256::from(2)) // [!code hl]
+ .with_to(address!("0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"))
+ .with_input(bytes!("cafebabe0000000000000000000000000000000001")),
+ ),
+ provider.send_transaction(
+ TempoTransactionRequest::default()
+ .with_nonce_key(U256::from(3)) // [!code hl]
+ .with_to(address!("0xcafebabecafebabecafebabecafebabecafebabe"))
+ .with_input(bytes!("deadbeef0000000000000000000000000000000001")),
+ ),
+ )?;
+
+ Ok(())
+ }
+ ```
+
+ ```rust [provider.rs]
+ // [!include ~/snippets/rust-signer-provider.rs:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```python [example.py]
+ from pytempo import Call, TempoTransaction
+ from provider import w3, account
+
+ # Send three transactions concurrently using different nonce keys
+ for nonce_key, to, data in [
+ (1, "0xcafebabecafebabecafebabecafebabecafebabe", "0xdeadbeef0000000000000000000000000000000001"),
+ (2, "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", "0xcafebabe0000000000000000000000000000000001"),
+ (3, "0xcafebabecafebabecafebabecafebabecafebabe", "0xdeadbeef0000000000000000000000000000000001"),
+ ]:
+ tx = TempoTransaction.create(
+ chain_id=w3.eth.chain_id,
+ gas_limit=300_000,
+ max_fee_per_gas=w3.eth.gas_price * 2,
+ max_priority_fee_per_gas=w3.eth.gas_price,
+ nonce=0,
+ nonce_key=nonce_key, # [!code hl]
+ calls=(Call.create(to=to, data=data),),
+ )
+ signed_tx = tx.sign(account.key.hex())
+ w3.eth.send_raw_transaction(signed_tx.encode())
+ ```
+
+ ```python [provider.py]
+ from web3 import Web3
+ from eth_account import Account
+
+ w3 = Web3(Web3.HTTPProvider("https://rpc.tempo.xyz"))
+ account = Account.from_key("0x...")
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```go [main.go]
+ package main
+
+ import (
+ "context"
+ "log"
+ "math/big"
+ "sync"
+
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/tempoxyz/tempo-go/pkg/signer"
+ "github.com/tempoxyz/tempo-go/pkg/transaction"
+ )
+
+ func main() {
+ sgn, _ := signer.NewSigner("0x...")
+ c := newClient()
+ ctx := context.Background()
+
+ // Send three transactions concurrently using different nonce keys
+ type txParams struct {
+ nonceKey int64
+ to string
+ data string
+ }
+ params := []txParams{
+ {1, "0xcafebabecafebabecafebabecafebabecafebabe", "deadbeef0000000000000000000000000000000001"},
+ {2, "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", "cafebabe0000000000000000000000000000000001"},
+ {3, "0xcafebabecafebabecafebabecafebabecafebabe", "deadbeef0000000000000000000000000000000001"},
+ }
+
+ var wg sync.WaitGroup
+ for _, p := range params {
+ wg.Add(1)
+ go func(p txParams) {
+ defer wg.Done()
+ tx := transaction.NewBuilder(big.NewInt(transaction.ChainIdMainnet)).
+ SetNonce(0).
+ SetNonceKey(big.NewInt(p.nonceKey)). // [!code hl]
+ SetGas(300_000).
+ SetMaxFeePerGas(big.NewInt(25_000_000_000)).
+ SetMaxPriorityFeePerGas(big.NewInt(1_000_000_000)).
+ AddCall(
+ common.HexToAddress(p.to),
+ big.NewInt(0),
+ common.Hex2Bytes(p.data),
+ ).
+ Build()
+
+ _ = transaction.SignTransaction(tx, sgn)
+ serialized, _ := transaction.Serialize(tx, nil)
+ txHash, _ := c.SendRawTransaction(ctx, serialized)
+
+ log.Printf("Nonce key %d tx: %s", p.nonceKey, txHash)
+ }(p)
+ }
+ wg.Wait()
+ }
+ ```
+
+ ```go [provider.go]
+ // [!include ~/snippets/go-provider.go:setup]
+ ```
+
+ :::
+
+
+
+
+
+ ```bash
+ # Send three transactions concurrently using different nonce keys
+ $ cast send 0xcafebabecafebabecafebabecafebabecafebabe \
+ --data 0xdeadbeef0000000000000000000000000000000001 \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $PRIVATE_KEY \
+ --async --nonce 0 --tempo.nonce-key 1 # [!code hl]
+
+ $ cast send 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef \
+ --data 0xcafebabe0000000000000000000000000000000001 \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $PRIVATE_KEY \
+ --async --nonce 0 --tempo.nonce-key 2 # [!code hl]
+
+ $ cast send 0xcafebabecafebabecafebabecafebabecafebabe \
+ --data 0xdeadbeef0000000000000000000000000000000001 \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $PRIVATE_KEY \
+ --async --nonce 0 --tempo.nonce-key 3 # [!code hl]
+ ```
+
+
+
+
+
+ ```tsx
+ rlp([
+ chain_id,
+ max_priority_fee_per_gas,
+ max_fee_per_gas,
+ gas,
+ calls,
+ access_list,
+ nonce_key, // [!code focus]
+ nonce,
+ valid_before, // [!code focus]
+ valid_after,
+ fee_token,
+ fee_payer_signature,
+ aa_authorization_list,
+ key_authorization,
+ signature,
+ ])
+ ```
+
+
+
+### Expiring Nonces
+
+[TIP-1009](/protocol/tips/tip-1009) introduces expiring nonces: transactions automatically expire if not executed within a specified time window.
+
+**Benefits:**
+- No nonce tracking required
+- Automatic replay protection via circular buffer
+- No permanent state bloat from unused nonce keys
+
+Expiring nonces can be used by setting `nonceKey` to `maxUint256` and `validBefore` to a time in the future (within 30 seconds).
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { maxUint256 } from 'viem'
+ import { client } from './viem.config'
+
+ const receipt = await client.sendTransactionSync({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ nonceKey: maxUint256, // [!code focus]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ validBefore: Math.floor(Date.now() / 1000) + 20, // [!code focus]
+ })
+ ```
+
+ ```tsx twoslash [viem.config.ts] filename="viem.config.ts"
+ // [!include ~/snippets/viem.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { maxUint256 } from 'viem'
+ import { useSendTransaction } from 'wagmi'
+
+ const { sendTransaction } = useSendTransaction()
+
+ sendTransaction({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ nonceKey: maxUint256, // [!code focus]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ validBefore: Math.floor(Date.now() / 1000) + 20, // [!code focus]
+ })
+ ```
+
+ ```tsx twoslash [wagmi.config.ts]
+ // @noErrors
+ // [!include ~/snippets/wagmi.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```rust [example.rs]
+ use std::time::{SystemTime, UNIX_EPOCH};
+
+ use alloy::primitives::{U256, address, bytes};
+ use alloy::providers::Provider;
+ use tempo_alloy::rpc::TempoTransactionRequest;
+
+ mod provider;
+
+ #[tokio::main]
+ async fn main() -> Result<(), Box> {
+ let provider = provider::get_provider().await?;
+
+ let valid_before = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() + 30;
+
+ let pending = provider
+ .send_transaction(
+ TempoTransactionRequest::default()
+ .with_nonce_key(U256::MAX) // [!code focus]
+ .with_valid_before(valid_before) // [!code focus]
+ .with_to(address!("0xcafebabecafebabecafebabecafebabecafebabe"))
+ .with_input(bytes!("deadbeef0000000000000000000000000000000001")),
+ )
+ .await?;
+
+ Ok(())
+ }
+ ```
+
+ ```rust [provider.rs]
+ // [!include ~/snippets/rust-signer-provider.rs:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```python [example.py]
+ import time
+
+ from pytempo import Call, TempoTransaction
+ from provider import w3, account
+
+ # maxUint256: signals an expiring nonce
+ MAX_UINT256 = 2**256 - 1
+ valid_before = int(time.time()) + 20
+
+ tx = TempoTransaction.create(
+ chain_id=w3.eth.chain_id,
+ gas_limit=300_000,
+ max_fee_per_gas=w3.eth.gas_price * 2,
+ max_priority_fee_per_gas=w3.eth.gas_price,
+ nonce_key=MAX_UINT256, # [!code focus]
+ valid_before=valid_before, # [!code focus]
+ calls=(
+ Call.create(
+ to="0xcafebabecafebabecafebabecafebabecafebabe",
+ data="0xdeadbeef0000000000000000000000000000000001",
+ ),
+ ),
+ )
+
+ signed_tx = tx.sign(account.key.hex())
+ tx_hash = w3.eth.send_raw_transaction(signed_tx.encode())
+ ```
+
+ ```python [provider.py]
+ from web3 import Web3
+ from eth_account import Account
+
+ w3 = Web3(Web3.HTTPProvider("https://rpc.tempo.xyz"))
+ account = Account.from_key("0x...")
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```go [main.go]
+ package main
+
+ import (
+ "context"
+ "log"
+ "math/big"
+ "time"
+
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/tempoxyz/tempo-go/pkg/signer"
+ "github.com/tempoxyz/tempo-go/pkg/transaction"
+ )
+
+ func main() {
+ sgn, _ := signer.NewSigner("0x...")
+ c := newClient()
+ ctx := context.Background()
+
+ // maxUint256: signals an expiring nonce
+ maxUint256, _ := new(big.Int).SetString("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)
+
+ validBefore := uint64(time.Now().Unix()) + 20
+
+ tx := transaction.NewBuilder(big.NewInt(transaction.ChainIdMainnet)).
+ SetGas(300_000).
+ SetMaxFeePerGas(big.NewInt(25_000_000_000)).
+ SetMaxPriorityFeePerGas(big.NewInt(1_000_000_000)).
+ SetNonceKey(maxUint256). // [!code focus]
+ SetValidBefore(validBefore). // [!code focus]
+ AddCall(
+ common.HexToAddress("0xcafebabecafebabecafebabecafebabecafebabe"),
+ big.NewInt(0),
+ common.Hex2Bytes("deadbeef0000000000000000000000000000000001"),
+ ).
+ Build()
+
+ _ = transaction.SignTransaction(tx, sgn)
+ serialized, _ := transaction.Serialize(tx, nil)
+ txHash, _ := c.SendRawTransaction(ctx, serialized)
+
+ log.Printf("Transaction hash: %s", txHash)
+ }
+ ```
+
+ ```go [provider.go]
+ // [!include ~/snippets/go-provider.go:setup]
+ ```
+
+ :::
+
+
+
+
+
+ ```bash
+ $ VALID_BEFORE=$(($(date +%s) + 20))
+ $ cast send 0xcafebabecafebabecafebabecafebabecafebabe \
+ --data 0xdeadbeef0000000000000000000000000000000001 \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $PRIVATE_KEY \
+ --tempo.expiring-nonce --tempo.valid-before $VALID_BEFORE # [!code hl]
+ ```
+
+
+
+
+
+ ```tsx
+ rlp([
+ chain_id,
+ max_priority_fee_per_gas,
+ max_fee_per_gas,
+ gas,
+ calls,
+ access_list,
+ nonce_key, // set to `maxUint256` // [!code focus]
+ nonce,
+ valid_before, // set to `now + <30 seconds` // [!code focus]
+ valid_after,
+ fee_token,
+ fee_payer_signature,
+ aa_authorization_list,
+ key_authorization,
+ signature,
+ ])
+ ```
+
+
+
+### 2D Nonces
+
+For cases requiring ordered sequences within a key, Tempo's **2D nonce system** enables parallel transaction execution:
+
+- **Protocol nonce (key 0)**: The default sequential nonce. Transactions must be processed in order.
+- **User nonces (keys 1+)**: Independent nonce sequences that allow concurrent transaction submission.
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { client } from './viem.config'
+
+ const [receipt1, receipt2, receipt3] = await Promise.all([
+ client.sendTransactionSync({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ nonceKey: 1n, // [!code focus]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ }),
+ client.sendTransactionSync({
+ data: '0xcafebabe0000000000000000000000000000000001',
+ nonceKey: 2n, // [!code focus]
+ to: '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
+ }),
+ client.sendTransactionSync({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ nonceKey: 3n, // [!code focus]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ }),
+ ])
+ ```
+
+ ```tsx twoslash [viem.config.ts]
+ // [!include ~/snippets/viem.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { useSendTransaction } from 'wagmi'
+
+ const { sendTransaction } = useSendTransaction()
+
+ sendTransaction({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ nonceKey: 1n, // [!code focus]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ })
+ sendTransaction({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ nonceKey: 2n, // [!code focus]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ })
+ sendTransaction({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ nonceKey: 3n, // [!code focus]
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ })
+ ```
+
+ ```tsx twoslash [wagmi.config.ts]
+ // @noErrors
+ // [!include ~/snippets/wagmi.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```rust [example.rs]
+ use alloy::primitives::{U256, address, bytes};
+ use alloy::providers::Provider;
+ use tempo_alloy::rpc::TempoTransactionRequest;
+
+ mod provider;
+
+ #[tokio::main]
+ async fn main() -> Result<(), Box> {
+ let provider = provider::get_provider().await?;
+
+ let (r1, r2, r3) = tokio::try_join!(
+ provider.send_transaction(
+ TempoTransactionRequest::default()
+ .with_nonce_key(U256::from(1)) // [!code focus]
+ .with_to(address!("0xcafebabecafebabecafebabecafebabecafebabe"))
+ .with_input(bytes!("deadbeef0000000000000000000000000000000001")),
+ ),
+ provider.send_transaction(
+ TempoTransactionRequest::default()
+ .with_nonce_key(U256::from(2)) // [!code focus]
+ .with_to(address!("0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"))
+ .with_input(bytes!("cafebabe0000000000000000000000000000000001")),
+ ),
+ provider.send_transaction(
+ TempoTransactionRequest::default()
+ .with_nonce_key(U256::from(3)) // [!code focus]
+ .with_to(address!("0xcafebabecafebabecafebabecafebabecafebabe"))
+ .with_input(bytes!("deadbeef0000000000000000000000000000000001")),
+ ),
+ )?;
+
+ Ok(())
+ }
+ ```
+
+ ```rust [provider.rs]
+ // [!include ~/snippets/rust-signer-provider.rs:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```python [example.py]
+ from pytempo import Call, TempoTransaction
+ from provider import w3, account
+
+ for nonce_key, to, data in [
+ (1, "0xcafebabecafebabecafebabecafebabecafebabe", "0xdeadbeef0000000000000000000000000000000001"),
+ (2, "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", "0xcafebabe0000000000000000000000000000000001"),
+ (3, "0xcafebabecafebabecafebabecafebabecafebabe", "0xdeadbeef0000000000000000000000000000000001"),
+ ]:
+ tx = TempoTransaction.create(
+ chain_id=w3.eth.chain_id,
+ gas_limit=300_000,
+ max_fee_per_gas=w3.eth.gas_price * 2,
+ max_priority_fee_per_gas=w3.eth.gas_price,
+ nonce=0,
+ nonce_key=nonce_key, # [!code focus]
+ calls=(Call.create(to=to, data=data),),
+ )
+ signed_tx = tx.sign(account.key.hex())
+ w3.eth.send_raw_transaction(signed_tx.encode())
+ ```
+
+ ```python [provider.py]
+ from web3 import Web3
+ from eth_account import Account
+
+ w3 = Web3(Web3.HTTPProvider("https://rpc.tempo.xyz"))
+ account = Account.from_key("0x...")
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```go [main.go]
+ package main
+
+ import (
+ "context"
+ "log"
+ "math/big"
+ "sync"
+
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/tempoxyz/tempo-go/pkg/signer"
+ "github.com/tempoxyz/tempo-go/pkg/transaction"
+ )
+
+ func main() {
+ sgn, _ := signer.NewSigner("0x...")
+ c := newClient()
+ ctx := context.Background()
+
+ type txParams struct {
+ nonceKey int64
+ to string
+ data string
+ }
+ params := []txParams{
+ {1, "0xcafebabecafebabecafebabecafebabecafebabe", "deadbeef0000000000000000000000000000000001"},
+ {2, "0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", "cafebabe0000000000000000000000000000000001"},
+ {3, "0xcafebabecafebabecafebabecafebabecafebabe", "deadbeef0000000000000000000000000000000001"},
+ }
+
+ var wg sync.WaitGroup
+ for _, p := range params {
+ wg.Add(1)
+ go func(p txParams) {
+ defer wg.Done()
+ tx := transaction.NewBuilder(big.NewInt(transaction.ChainIdMainnet)).
+ SetNonce(0).
+ SetNonceKey(big.NewInt(p.nonceKey)). // [!code focus]
+ SetGas(300_000).
+ SetMaxFeePerGas(big.NewInt(25_000_000_000)).
+ SetMaxPriorityFeePerGas(big.NewInt(1_000_000_000)).
+ AddCall(
+ common.HexToAddress(p.to),
+ big.NewInt(0),
+ common.Hex2Bytes(p.data),
+ ).
+ Build()
+
+ _ = transaction.SignTransaction(tx, sgn)
+ serialized, _ := transaction.Serialize(tx, nil)
+ txHash, _ := c.SendRawTransaction(ctx, serialized)
+
+ log.Printf("Nonce key %d tx: %s", p.nonceKey, txHash)
+ }(p)
+ }
+ wg.Wait()
+ }
+ ```
+
+ ```go [provider.go]
+ // [!include ~/snippets/go-provider.go:setup]
+ ```
+
+ :::
+
+
+
+
+
+ ```bash
+ $ cast send 0xcafebabecafebabecafebabecafebabecafebabe \
+ --data 0xdeadbeef0000000000000000000000000000000001 \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $PRIVATE_KEY \
+ --nonce 0 --tempo.nonce-key 1 # [!code hl]
+
+ $ cast send 0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef \
+ --data 0xcafebabe0000000000000000000000000000000001 \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $PRIVATE_KEY \
+ --nonce 0 --tempo.nonce-key 2 # [!code hl]
+
+ $ cast send 0xcafebabecafebabecafebabecafebabecafebabe \
+ --data 0xdeadbeef0000000000000000000000000000000001 \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $PRIVATE_KEY \
+ --nonce 0 --tempo.nonce-key 3 # [!code hl]
+ ```
+
+
+
+
+
+ ```tsx
+ rlp([
+ chain_id,
+ max_priority_fee_per_gas,
+ max_fee_per_gas,
+ gas,
+ calls,
+ access_list,
+ nonce_key, // [!code focus]
+ nonce,
+ valid_before,
+ valid_after,
+ fee_token,
+ fee_payer_signature,
+ aa_authorization_list,
+ key_authorization,
+ signature,
+ ])
+ ```
+
+
+
+:::warning
+**Reuse nonce keys instead of generating random ones.** Creating a new nonce key incurs a state creation cost that increases with the number of active keys (see [TIP-1000](/protocol/tips/tip-1000)). For most applications, using a small set of sequential nonce keys (e.g., `1n`, `2n`, `3n`) is sufficient and much more cost-effective than generating random nonce keys for each transaction.
+:::
+
+### Scheduled Transactions
+
+Scheduled transactions allow you to sign a transaction in advance and specify a time window for when it can be
+executed onchain. By setting `validAfter` and `validBefore` timestamps, you define the earliest and latest times
+the transaction can be included in a block.
+
+
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { client } from './viem.config'
+
+ const signature = await client.signTransaction({
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ validAfter: Math.floor(Number(new Date('2026-01-01')) / 1000), // [!code hl]
+ validBefore: Math.floor(Number(new Date('2026-01-02')) / 1000), // [!code hl]
+ })
+ ```
+
+ ```tsx twoslash [viem.config.ts]
+ // [!include ~/snippets/viem.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```tsx twoslash [example.ts]
+ // @noErrors
+ import { signTransaction } from 'wagmi/actions'
+ import { config } from './wagmi.config'
+
+ const signature = await signTransaction(config, {
+ data: '0xdeadbeef0000000000000000000000000000000001',
+ to: '0xcafebabecafebabecafebabecafebabecafebabe',
+ validAfter: Math.floor(Number(new Date('2026-01-01')) / 1000), // [!code hl]
+ validBefore: Math.floor(Number(new Date('2026-01-02')) / 1000), // [!code hl]
+ })
+ ```
+
+ ```tsx twoslash [wagmi.config.ts]
+ // @noErrors
+ // [!include ~/snippets/wagmi.config.ts:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```rust [example.rs]
+ use alloy::primitives::{address, bytes};
+ use alloy::providers::Provider;
+ use tempo_alloy::rpc::TempoTransactionRequest;
+
+ mod provider;
+
+ #[tokio::main]
+ async fn main() -> Result<(), Box> {
+ let provider = provider::get_provider().await?;
+
+ // 2026-01-01 00:00:00 UTC
+ let valid_after = 1_767_225_600;
+ // 2026-01-02 00:00:00 UTC
+ let valid_before = 1_767_312_000;
+
+ let pending = provider
+ .send_transaction(
+ TempoTransactionRequest::default()
+ .with_valid_after(valid_after) // [!code hl]
+ .with_valid_before(valid_before) // [!code hl]
+ .with_to(address!("0xcafebabecafebabecafebabecafebabecafebabe"))
+ .with_input(bytes!("deadbeef0000000000000000000000000000000001")),
+ )
+ .await?;
+
+ Ok(())
+ }
+ ```
+
+ ```rust [provider.rs]
+ // [!include ~/snippets/rust-signer-provider.rs:setup]
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```python [example.py]
+ from datetime import datetime, timezone
+
+ from pytempo import Call, TempoTransaction
+ from provider import w3, account
+
+ # 2026-01-01 00:00:00 UTC
+ valid_after = int(datetime(2026, 1, 1, tzinfo=timezone.utc).timestamp())
+ # 2026-01-02 00:00:00 UTC
+ valid_before = int(datetime(2026, 1, 2, tzinfo=timezone.utc).timestamp())
+
+ tx = TempoTransaction.create(
+ chain_id=w3.eth.chain_id,
+ gas_limit=300_000,
+ max_fee_per_gas=w3.eth.gas_price * 2,
+ max_priority_fee_per_gas=w3.eth.gas_price,
+ nonce=w3.eth.get_transaction_count(account.address),
+ valid_after=valid_after, # [!code hl]
+ valid_before=valid_before, # [!code hl]
+ calls=(
+ Call.create(
+ to="0xcafebabecafebabecafebabecafebabecafebabe",
+ data="0xdeadbeef0000000000000000000000000000000001",
+ ),
+ ),
+ )
+
+ # Sign now, submit to the network for later execution
+ signed_tx = tx.sign(account.key.hex())
+ tx_hash = w3.eth.send_raw_transaction(signed_tx.encode())
+ ```
+
+ ```python [provider.py]
+ from web3 import Web3
+ from eth_account import Account
+
+ w3 = Web3(Web3.HTTPProvider("https://rpc.tempo.xyz"))
+ account = Account.from_key("0x...")
+ ```
+
+ :::
+
+
+
+
+
+ :::code-group
+
+ ```go [main.go]
+ package main
+
+ import (
+ "context"
+ "log"
+ "math/big"
+ "time"
+
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/tempoxyz/tempo-go/pkg/signer"
+ "github.com/tempoxyz/tempo-go/pkg/transaction"
+ )
+
+ func main() {
+ sgn, _ := signer.NewSigner("0x...")
+ c := newClient()
+ ctx := context.Background()
+
+ nonce, _ := c.GetTransactionCount(ctx, sgn.Address().Hex())
+
+ // 2026-01-01 00:00:00 UTC
+ validAfter := uint64(time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC).Unix())
+ // 2026-01-02 00:00:00 UTC
+ validBefore := uint64(time.Date(2026, 1, 2, 0, 0, 0, 0, time.UTC).Unix())
+
+ tx := transaction.NewBuilder(big.NewInt(transaction.ChainIdMainnet)).
+ SetNonce(nonce).
+ SetGas(300_000).
+ SetMaxFeePerGas(big.NewInt(25_000_000_000)).
+ SetMaxPriorityFeePerGas(big.NewInt(1_000_000_000)).
+ SetValidAfter(validAfter). // [!code hl]
+ SetValidBefore(validBefore). // [!code hl]
+ AddCall(
+ common.HexToAddress("0xcafebabecafebabecafebabecafebabecafebabe"),
+ big.NewInt(0),
+ common.Hex2Bytes("deadbeef0000000000000000000000000000000001"),
+ ).
+ Build()
+
+ // Sign now, submit to the network for later execution
+ _ = transaction.SignTransaction(tx, sgn)
+ serialized, _ := transaction.Serialize(tx, nil)
+ txHash, _ := c.SendRawTransaction(ctx, serialized)
+
+ log.Printf("Transaction hash: %s", txHash)
+ }
+ ```
+
+ ```go [provider.go]
+ // [!include ~/snippets/go-provider.go:setup]
+ ```
+
+ :::
+
+
+
+
+
+ ```bash
+ $ VALID_AFTER=$(date -d '2026-01-01' +%s)
+ $ VALID_BEFORE=$(date -d '2026-01-02' +%s)
+ $ cast mktx 0xcafebabecafebabecafebabecafebabecafebabe \
+ --data 0xdeadbeef0000000000000000000000000000000001 \
+ --rpc-url $TEMPO_RPC_URL \
+ --private-key $PRIVATE_KEY \
+ --tempo.valid-after $VALID_AFTER \
+ --tempo.valid-before $VALID_BEFORE # [!code hl]
+ ```
+
+
+
+
+
+ ```tsx
+ rlp([
+ chain_id,
+ max_priority_fee_per_gas,
+ max_fee_per_gas,
+ gas,
+ calls,
+ access_list,
+ nonce_key,
+ nonce,
+ valid_before, // [!code focus]
+ valid_after, // [!code focus]
+ fee_token,
+ fee_payer_signature,
+ aa_authorization_list,
+ key_authorization,
+ signature,
+ ])
+ ```
+
+
diff --git a/vocs.config.ts b/vocs.config.ts
index e6a3ca85..8a8a5ecd 100644
--- a/vocs.config.ts
+++ b/vocs.config.ts
@@ -597,7 +597,7 @@ export default defineConfig({
link: '/protocol/upgrades/t3',
},
{
- text: 'T2',
+ text: 'T2 (Active)',
link: '/protocol/upgrades/t2',
},
],