You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: llms.txt
+21-24Lines changed: 21 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -14077,57 +14077,54 @@ description: Understand how to construct, sign, and broadcast transactions in th
14077
14077
14078
14078
## Introduction
14079
14079
14080
-
This page will discuss the transaction format in Polkadot and how to create, sign, and broadcast
14081
-
transactions. Like the other pages in this guide, this page demonstrates some of the available
14082
-
tools.
14080
+
This page will discuss the transaction format in Polkadot and how to create, sign, and broadcast transactions. Like the other pages in this guide, this page demonstrates some of the available tools.
14083
14081
14084
14082
**Always refer to each tool's documentation when integrating.**
14085
14083
14086
-
!!!note "Complementary Reading"
14087
-
Learn about the basics of [blocks, transactions, and fees](/polkadot-protocol/parachain-basics/blocks-transactions-fees/).
14084
+
For further reading, refer to [blocks, transactions, and fees](/polkadot-protocol/parachain-basics/blocks-transactions-fees/){target=\_blank} to learn more about the basics.
14088
14085
14089
14086
## Transaction Format
14090
14087
14091
14088
Polkadot has some basic transaction information that is common to all transactions.
14092
14089
14093
-
- Address: The SS58-encoded address of the sending account.
14094
-
- Block Hash: The hash of the [checkpoint](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality) block.
14090
+
- Address: The [SS58-encoded address](/polkadot-protocol/glossary/#ss58-address-format){target=\_blank} of the sending account.
14091
+
- Block Hash: The hash of the [checkpoint](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality){target=\_blank} block.
14095
14092
- Block Number: The number of the checkpoint block.
14096
14093
- Genesis Hash: The genesis hash of the chain.
14097
14094
- Metadata: The SCALE-encoded metadata for the runtime when submitted.
14098
-
- Nonce: The nonce for this transaction.\*
14095
+
- Nonce: The nonce for this transaction.
14099
14096
- Spec Version: The current spec version for the runtime.
14100
14097
- Transaction Version: The current version for transaction format.
14101
-
- Tip: Optional, the [tip](https://docs.polkadot.com/polkadot-protocol/parachain-basics/blocks-transactions-fees/fees/#how-fees-are-calculated) to increase transaction priority.
14098
+
- Tip: Optional, the [tip](https://docs.polkadot.com/polkadot-protocol/parachain-basics/blocks-transactions-fees/fees/#how-fees-are-calculated){target=\_blank} to increase transaction priority.
14102
14099
- Mode: The flag indicating whether to verify the metadata hash or not.
14103
14100
- Era Period: Optional, the number of blocks after the checkpoint for which a transaction is valid.
14104
-
If zero, the transaction is [immortal](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality)
14101
+
If zero, the transaction is [immortal](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality){target=\_blank}
14105
14102
- MetadataHash: Optional, the metadata hash which should match the RUNTIME_METADATA_HASH environment
14106
14103
variable.
14107
14104
14108
14105
!!!warning
14109
-
There are risks to making a transaction immortal. If an account is reaped and a user re-funds the
14106
+
There are risks to making a transaction immortal. If an account is reaped and a user re-funds the
14110
14107
account, then they could replay an immortal transaction. Always default to using a mortal extrinsic.
14111
-
14112
-
The nonce queried from the System module does not account for pending transactions. You must track
14108
+
14109
+
The nonce queried from the System module does not account for pending transactions. You must track
14113
14110
and increment the nonce manually if you want to submit multiple valid transactions at the same time.
14114
14111
14115
-
Each transaction will have its own (or no) parameters to add. For example, the `transferKeepAlive`
14112
+
Each transaction will have its own (or no) parameters to add. For example, the [`transferKeepAlive`](https://paritytech.github.io/polkadot-sdk/master/pallet_balances/pallet/enum.Call.html#variant.transfer_keep_alive){target=\_blank}
14116
14113
function from the Balances pallet will take:
14117
14114
14118
14115
- `dest`: Destination address
14119
14116
- `#[compact] value`: Number of tokens (compact encoding)
14120
14117
14121
-
Refer to [the protocol specifications](https://spec.polkadot.network/id-extrinsics), for the
14118
+
Refer to [the protocol specifications](https://spec.polkadot.network/id-extrinsics){target=\_blank}, for the
14122
14119
concrete specifications and types to build a transaction.
14123
14120
14124
14121
**Mode and MetadataHash**
14125
14122
14126
14123
The mode and metadataHash fields were introduced in transaction construction to support the optional
14127
-
[`CheckMetadataHash` Signed Extension](https://github.com/polkadot-fellows/RFCs/blob/main/text/0078-merkleized-metadata.md).
14124
+
[`CheckMetadataHash` Signed Extension](https://github.com/polkadot-fellows/RFCs/blob/main/text/0078-merkleized-metadata.md){target=\_blank}.
14128
14125
This enables trustless metadata verification by allowing the chain to verify the correctness of the
14129
14126
metadata used without the need of a trusted party. This functionality was included in
14130
-
[v1.2.5](https://github.com/polkadot-fellows/runtimes/releases/tag/v1.2.5) runtime release by the
14127
+
[v1.2.5](https://github.com/polkadot-fellows/runtimes/releases/tag/v1.2.5){target=\_blank} runtime release by the
14131
14128
Fellowship. A user may opt out of this functionality by setting the mode to `0`. When the mode is 00,
14132
14129
the `metadataHash` field is empty/None.
14133
14130
@@ -14138,7 +14135,7 @@ SCALE-encoded bytes. The relay chain runtimes are upgradable and therefore any i
14138
14135
subject to change, the metadata allows developers to structure any extrinsics or storage entries
14139
14136
accordingly. The metadata provides you with all of the information required to know how to construct
14140
14137
the serialized call data specific to your transaction. You can read more about the metadata, its
14141
-
format and how to get it in the [Subxt documentation](/polkadot-protocol/parachain-basics/chain-data/#use-subxt).
14138
+
format and how to get it in the [Subxt documentation](/polkadot-protocol/parachain-basics/chain-data/#use-subxt){target=\_blank}.
14142
14139
14143
14140
**Transaction Flow**
14144
14141
@@ -14154,7 +14151,7 @@ Parity provides the following tools to help perform these steps.
14154
14151
14155
14152
## Polkadot-JS Tools
14156
14153
14157
-
[Polkadot-JS Tools](https://github.com/polkadot-js/tools) contains a set of command line tools for
14154
+
[Polkadot-JS Tools](https://github.com/polkadot-js/tools){target=\_blank} contains a set of command line tools for
14158
14155
interacting with a Substrate client, including one called "Signer CLI" to create, sign, and
14159
14156
broadcast transactions.
14160
14157
@@ -14193,10 +14190,10 @@ signature field, and send the transaction (or just return the serialized transac
14193
14190
## TxWrapper
14194
14191
14195
14192
If you do not want to use the CLI for signing operations, Parity provides an SDK called
14196
-
[TxWrapper Core](https://github.com/paritytech/txwrapper-core) to generate and sign transactions
14193
+
[TxWrapper Core](https://github.com/paritytech/txwrapper-core){target=\_blank} to generate and sign transactions
14197
14194
offline. For Polkadot, Kusama, and select parachains, use the `txwrapper-polkadot` package. Other
14198
14195
Substrate-based chains will have their own `txwrapper-{chain}` implementations. See the
0 commit comments