Welcome to Relaycode! This tutorial will guide you through building and submitting your first extrinsic on Polkadot.
Relaycode is an extrinsic builder for the Polkadot ecosystem. It provides a user-friendly interface for:
- Building extrinsics - Construct any pallet call using human-readable forms
- Encoding/Decoding - Convert between form values and SCALE-encoded hex
- Wallet integration - Connect your wallet to sign and submit transactions
- Bi-directional editing - Edit via form or raw hex, with real-time sync
- A Polkadot-compatible wallet (Polkadot.js extension, Talisman, SubWallet, etc.)
- Some DOT or testnet tokens for transaction fees
Before connecting, choose which chain to interact with using the Chain Selector dropdown in the navbar:
- Polkadot - Mainnet (real DOT)
- Kusama - Canary network (real KSM)
- Westend - Testnet (free test tokens, marked with "testnet" badge)
For your first time, we recommend selecting Westend so you can experiment without spending real tokens.
- Open Relaycode and navigate to the Builder page
- Select your chain from the chain selector dropdown
- Click "Connect" in the top navigation
- Select your wallet from the available options (Polkadot.js, Talisman, or SubWallet)
- Approve the connection in your wallet extension
- Your connected accounts will appear in the Account selector
Once connected, you'll see your account balance and be able to select accounts for transactions.
Relaycode uses a dual-pane interface:
┌─────────────────────────────────┬─────────────────────────────────┐
│ │ │
│ FORM PANE │ HEX PANE │
│ │ │
│ Human-readable inputs │ SCALE-encoded call data │
│ - Pallet selector │ - Live hex preview │
│ - Method selector │ - Editable hex input │
│ - Parameter inputs │ - Auto-decode on edit │
│ │ │
└─────────────────────────────────┴─────────────────────────────────┘
Left Pane (Form): Select pallets, methods, and fill in parameters using friendly input components.
Right Pane (Hex): See the resulting encoded call data in real-time. You can also paste hex to decode and edit.
Let's create a simple balance transfer:
- In the Pallet dropdown, search for and select "Balances"
- In the Method dropdown, select "transferKeepAlive"
The form will update to show the required parameters.
The transfer requires two parameters:
dest (Destination)
- Click the destination field
- Select an account from your connected accounts, or
- Paste an SS58 address, or
- Select from recent addresses
value (Amount)
- Enter the amount to transfer
- Use the denomination selector (DOT, mDOT, planck)
- Your available balance is shown below the input
- Click "Max" to fill your maximum transferable amount
As you fill in the form, the right pane updates with the encoded call data:
0x0503d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0700e8764817
This hex represents your complete extrinsic call:
05- Balances pallet index03- transferKeepAlive method index- Remaining bytes - Encoded destination and amount
- Review your transaction details
- Click "Submit"
- Your wallet will prompt you to sign
- Approve the transaction in your wallet
- Wait for confirmation
You'll see a success message with the transaction hash once it's included in a block.
Relaycode provides specialized inputs for different Substrate types:
For addresses and account IDs:
- Dropdown with connected accounts
- Recent address history
- Paste any valid SS58 address
- Automatic format validation
For token amounts:
- Human-readable input (e.g., "1.5")
- Denomination selector (DOT/mDOT/planck)
- Automatic conversion to planck
- Available balance display
- Existential deposit warning
For plain integers (u32, u64, u128):
- Simple numeric input
- Supports large numbers (BigInt)
For true/false values:
- Toggle switch
For block hashes, extrinsic hashes:
- H160 (20-byte), H256 (32-byte), H512 (64-byte)
- Format and length validation
For arrays (Vec):
- Add/remove items
- Dynamic length
For fixed-length arrays ([T; N]):
- Fixed number of elements — no add/remove
- Each element uses the appropriate typed input
For key-value maps (BTreeMap<K, V>):
- Add/remove key-value pairs
- Typed inputs for keys and values
For optional values (Option):
- Toggle to enable/disable
- Inner input when enabled
Here are some common extrinsics you can build:
Pallet: Balances Method: transferKeepAlive Parameters:
- dest: Destination address
- value: Amount in planck
Pallet: System Method: remark Parameters:
- remark: Bytes data (hex)
Pallet: Identity Method: setIdentity Parameters:
- info: Identity info struct
Pallet: Utility Method: batch Parameters:
- calls: Array of nested calls
- Ensure the address uses valid Base58 characters
- Check the address length (typically 47-48 characters)
- Verify it's a valid SS58 address for the target chain
- Account needs funds for transfer + fees
- Remember the existential deposit (1 DOT on Polkadot)
- Check wallet is connected
- Ensure you have enough balance for fees
- Check network connectivity
- Ensure hex is valid (starts with 0x)
- Hex must match the selected pallet/method
- Check for encoding errors in the hex
Now that you've completed your first transaction, explore:
- Advanced Usage - Bi-directional editing, batch calls, complex types
- API Reference - Use Relaycode programmatically
- Component Reference - Understand input components