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
Creating accounts is a fundamental operation when building applications on Polkadot and its parachains. Accounts serve as the basis for identity, asset ownership, and transaction signing. Understanding how to generate and manage accounts programmatically enables you to build wallets, automate operations, and create seamless user experiences.
12
12
13
+
Polkadot accounts are based on the SR25519 signature scheme by default, though ED25519 and ECDSA are also supported. Each account consists of a public key (address) and a private key (seed/mnemonic). **Keep your private keys secure and never share them**.
14
+
13
15
This tutorial will guide you through creating accounts using different programming languages and libraries.
14
16
15
17
## Prerequisites
@@ -20,138 +22,135 @@ Before starting, make sure you have:
20
22
- Development environment set up for your chosen language
21
23
- Familiarity with the programming language you'll be using
22
24
23
-
!!! note
24
-
Polkadot accounts are based on the SR25519 signature scheme by default, though ED25519 and ECDSA are also supported. Each account consists of a public key (address) and a private key (seed/mnemonic). Keep your private keys secure and never share them.
25
+
## Use JavaScript/TypeScript
25
26
26
-
## JavaScript/TypeScript
27
+
JavaScript/TypeScript developers can use the Polkadot.js API to create and manage Polkadot accounts.
27
28
28
-
Create a new project directory and initialize it:
29
+
1.Create a new project directory and initialize it:
- **Keypair generation**: [`sr25519::Pair::generate_with_phrase()`](https://docs.rs/sp-core/latest/sp_core/crypto/trait.Pair.html#method.generate_with_phrase){target=\_blank} creates a new key pair with mnemonic
138
-
- **Public key extraction**: The [`public()`](https://docs.rs/sp-core/latest/sp_core/crypto/trait.Pair.html#tymethod.public){target=\_blank} method retrieves the public key from the pair
- **Keypair generation**: [`sr25519::Pair::generate_with_phrase()`](https://docs.rs/sp-core/latest/sp_core/crypto/trait.Pair.html#method.generate_with_phrase){target=\_blank} creates a new key pair with mnemonic.
139
+
- **Public key extraction**: The [`public()`](https://docs.rs/sp-core/latest/sp_core/crypto/trait.Pair.html#tymethod.public){target=\_blank} method retrieves the public key from the pair.
140
+
- **SS58 encoding**: Uses Polkadot's address format for the human-readable address.
0 commit comments