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: develop/toolkit/integrations/transaction-construction.md
+20-21Lines changed: 20 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,51 +11,50 @@ This page will discuss the transaction format in Polkadot and how to create, sig
11
11
12
12
**Always refer to each tool's documentation when integrating.**
13
13
14
-
!!!note "Complementary Reading"
15
-
Learn about the basics of [blocks, transactions, and fees](/polkadot-protocol/parachain-basics/blocks-transactions-fees/).
14
+
For further reading, refer to [blocks, transactions, and fees](/polkadot-protocol/parachain-basics/blocks-transactions-fees/){target=\_blank} to learn more about the basics.
16
15
17
16
## Transaction Format
18
17
19
18
Polkadot has some basic transaction information that is common to all transactions.
20
19
21
-
- Address: The SS58-encoded address of the sending account.
22
-
- Block Hash: The hash of the [checkpoint](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality) block.
20
+
- Address: The [SS58-encoded address](/polkadot-protocol/glossary/#ss58-address-format){target=\_blank} of the sending account.
21
+
- Block Hash: The hash of the [checkpoint](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality){target=\_blank} block.
23
22
- Block Number: The number of the checkpoint block.
24
23
- Genesis Hash: The genesis hash of the chain.
25
24
- Metadata: The SCALE-encoded metadata for the runtime when submitted.
26
-
- Nonce: The nonce for this transaction.\*
25
+
- Nonce: The nonce for this transaction.
27
26
- Spec Version: The current spec version for the runtime.
28
27
- Transaction Version: The current version for transaction format.
29
-
- Tip: Optional, the [tip](https://docs.polkadot.com/polkadot-protocol/parachain-basics/blocks-transactions-fees/fees/#how-fees-are-calculated) to increase transaction priority.
28
+
- 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.
30
29
- Mode: The flag indicating whether to verify the metadata hash or not.
31
30
- Era Period: Optional, the number of blocks after the checkpoint for which a transaction is valid.
32
-
If zero, the transaction is [immortal](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality)
31
+
If zero, the transaction is [immortal](/polkadot-protocol/parachain-basics/blocks-transactions-fees/transactions/#transaction-mortality){target=\_blank}
33
32
- MetadataHash: Optional, the metadata hash which should match the RUNTIME_METADATA_HASH environment
34
33
variable.
35
34
36
35
!!!warning
37
-
There are risks to making a transaction immortal. If an account is reaped and a user re-funds the
36
+
There are risks to making a transaction immortal. If an account is reaped and a user re-funds the
38
37
account, then they could replay an immortal transaction. Always default to using a mortal extrinsic.
39
-
40
-
The nonce queried from the System module does not account for pending transactions. You must track
38
+
39
+
The nonce queried from the System module does not account for pending transactions. You must track
41
40
and increment the nonce manually if you want to submit multiple valid transactions at the same time.
42
41
43
-
Each transaction will have its own (or no) parameters to add. For example, the `transferKeepAlive`
42
+
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}
44
43
function from the Balances pallet will take:
45
44
46
45
-`dest`: Destination address
47
46
-`#[compact] value`: Number of tokens (compact encoding)
48
47
49
-
Refer to [the protocol specifications](https://spec.polkadot.network/id-extrinsics), for the
48
+
Refer to [the protocol specifications](https://spec.polkadot.network/id-extrinsics){target=\_blank}, for the
50
49
concrete specifications and types to build a transaction.
51
50
52
51
**Mode and MetadataHash**
53
52
54
53
The mode and metadataHash fields were introduced in transaction construction to support the optional
55
-
[`CheckMetadataHash` Signed Extension](https://github.com/polkadot-fellows/RFCs/blob/main/text/0078-merkleized-metadata.md).
54
+
[`CheckMetadataHash` Signed Extension](https://github.com/polkadot-fellows/RFCs/blob/main/text/0078-merkleized-metadata.md){target=\_blank}.
56
55
This enables trustless metadata verification by allowing the chain to verify the correctness of the
57
56
metadata used without the need of a trusted party. This functionality was included in
58
-
[v1.2.5](https://github.com/polkadot-fellows/runtimes/releases/tag/v1.2.5) runtime release by the
57
+
[v1.2.5](https://github.com/polkadot-fellows/runtimes/releases/tag/v1.2.5){target=\_blank} runtime release by the
59
58
Fellowship. A user may opt out of this functionality by setting the mode to `0`. When the mode is 00,
60
59
the `metadataHash` field is empty/None.
61
60
@@ -66,7 +65,7 @@ SCALE-encoded bytes. The relay chain runtimes are upgradable and therefore any i
66
65
subject to change, the metadata allows developers to structure any extrinsics or storage entries
67
66
accordingly. The metadata provides you with all of the information required to know how to construct
68
67
the serialized call data specific to your transaction. You can read more about the metadata, its
69
-
format and how to get it in the [Subxt documentation](/polkadot-protocol/parachain-basics/chain-data/#use-subxt).
68
+
format and how to get it in the [Subxt documentation](/polkadot-protocol/parachain-basics/chain-data/#use-subxt){target=\_blank}.
70
69
71
70
**Transaction Flow**
72
71
@@ -82,7 +81,7 @@ Parity provides the following tools to help perform these steps.
82
81
83
82
## Polkadot-JS Tools
84
83
85
-
[Polkadot-JS Tools](https://github.com/polkadot-js/tools) contains a set of command line tools for
84
+
[Polkadot-JS Tools](https://github.com/polkadot-js/tools){target=\_blank} contains a set of command line tools for
86
85
interacting with a Substrate client, including one called "Signer CLI" to create, sign, and
87
86
broadcast transactions.
88
87
@@ -121,10 +120,10 @@ signature field, and send the transaction (or just return the serialized transac
121
120
## TxWrapper
122
121
123
122
If you do not want to use the CLI for signing operations, Parity provides an SDK called
124
-
[TxWrapper Core](https://github.com/paritytech/txwrapper-core) to generate and sign transactions
123
+
[TxWrapper Core](https://github.com/paritytech/txwrapper-core){target=\_blank} to generate and sign transactions
125
124
offline. For Polkadot, Kusama, and select parachains, use the `txwrapper-polkadot` package. Other
126
125
Substrate-based chains will have their own `txwrapper-{chain}` implementations. See the
0 commit comments