当前位置:网站首页>Technology | diverse substrate formats
Technology | diverse substrate formats
2022-07-06 10:16:00 【GearFans】
SS58 Address
SS58 Is a simple address format , Designed to be based on Substrate The chain of development . There is no problem using other address formats , but SS58 Is a default . SS58 Bitcoin based Base58-check Format , And made some modifications .
Type prefix
SS58 The format contains an address type prefix , Used to identify belonging to a specific network ( Parallel chain ) The address of . Different type prefixes , The beginning of the generated address is different .
polkadot There are many parallel chains on the network , Each parallel chain will specify 1 Prefixes , This will have its own specific format , It will be distinguished from the addresses of other parallel chains .
for instance :
- General purpose substrate The address is always in numbers 5 start
- polkadot The address is always in numbers 1 start
- kusama The address always begins with a capital letter , Such as C、D、F、G、H、J
following 4 The addresses look completely different , If you use subkey inspect Tools , You will find that they have the same public key, Public key .
5CCvtLnaPwk1cBo8wuayYAuwgCumHnssrY5Nxk7S7t1ruBU2 # substrate Type address
19E2g3eFj1V3ioeuYdygKk6XpuQz6S1w2os836nfy3P5bYL # polkadot Type address
CiYYf8T2JkwMqcaicQ2S8GwpoC16Th4Juv8MQPPbgEMe6dv # kusama Type address
211pcbTg6dkkcJrHxsSDTLQLzgLMXvjDpSMBGsXoJWzFtbPS # acala Type address
Friends with technical background can try subkey inspect, This command also shows which network the address is ( Parallel chain ) Of .
subkey inspect 5CyREBErNFhogptd92dtC8ybuoUczVYh2ijvdhTpS2PJGeq7
Network ID/version: substrate
Public key (hex): 0x28340716214bbe2fc67db7eec79ae267cb664fe74395ad9831dafa4d36d21716
Account ID: 0x28340716214bbe2fc67db7eec79ae267cb664fe74395ad9831dafa4d36d21716
SS58 Address: 5CyREBErNFhogptd92dtC8ybuoUczVYh2ijvdhTpS2PJGeq7
###########
subkey inspect 1uiNWVvE2yH8Mu96fgtLHokmRUGgo6q7DUQnzTAz7QpT5c5
Network ID/version: polkadot
Public key (hex): 0x28340716214bbe2fc67db7eec79ae267cb664fe74395ad9831dafa4d36d21716
Account ID: 0x28340716214bbe2fc67db7eec79ae267cb664fe74395ad9831dafa4d36d21716
SS58 Address: 1uiNWVvE2yH8Mu96fgtLHokmRUGgo6q7DUQnzTAz7QpT5c5
So these networks ( Parallel chain ) How is the type prefix specified ? You can check it out ss58-registry. Here is a simple table .
| Prefix | Address type | Address start | Address example |
|---|---|---|---|
| 0 | polkadot | 1 | 19E2g3eFj1V3ioeuYdygKk6XpuQz6S1w2os836nfy3P5bYL |
| 2 | kusama | C、D、F、G、H、J etc. | CiYYf8T2JkwMqcaicQ2S8GwpoC16Th4Juv8MQPPbgEMe6dv |
| 42 | substrate | 5 | 5CCvtLnaPwk1cBo8wuayYAuwgCumHnssrY5Nxk7S7t1ruBU2 |
| 10 | acala | 2 | 211pcbTg6dkkcJrHxsSDTLQLzgLMXvjDpSMBGsXoJWzFtbPS |
| 30 | phala | 3 | 3zm1nSHjnTFHjUwa5X2h1MiqvPCEdbKdbFRoaYPpZct1XJgD |
Different types of address translation
Yes 1 individual substrate Type of address 5CyREBErNFhogptd92dtC8ybuoUczVYh2ijvdhTpS2PJGeq7, How to convert it into polkadot The address of the type ?
We can use online tools Home | Polkadot Address Convertor Get the results 1uiNWVvE2yH8Mu96fgtLHokmRUGgo6q7DUQnzTAz7QpT5c5.
Subkey
Subkey It's follow Substrate Key generation program developed together . Its main function is to generate key pairs ( The current support sr25519, ed25519 and secp256k1), Yes SS58 Encode the address and restore the key from the mnemonic and the original seed . It can also be in the message ( Including encoded transactions ) Create and verify signatures on .
Generate address and key
generate Command to generate keys and addresses
subkey generate # Default generation sr25519 secret key
Output results
Secret phrase `spend report solution aspect tilt omit market cancel what type cave author` is account:
Secret seed: 0x554b6fc625fbea8f56eb56262d92ccb083fd6eaaf5ee9a966eaab4db2062f4d0
Public key (hex): 0x143fa4ecea108937a2324d36ee4cbce3c6f3a08b0499b276cd7adb7a7631a559
Account ID: 0x143fa4ecea108937a2324d36ee4cbce3c6f3a08b0499b276cd7adb7a7631a559
SS58 Address: 5CXFinBHRrArHzmC6iYVHSSgY1wMQEdL2AiL6RmSEsFvWezd
generate We also support the following Sons command
subkey generate -n polkadot
subkey generate --scheme ed25519 # Generate ed25519 Type key
subkey generate --words 12 # ( Support 12、15、18、21 and 24)
Inspection address
inspect The command can recalculate the public key and address of the key pair according to the given key seed .
subkey inspect 5CyREBErNFhogptd92dtC8ybuoUczVYh2ijvdhTpS2PJGeq7
Output results
Network ID/version: substrate # Address type
Public key (hex): 0x28340716214bbe2fc67db7eec79ae267cb664fe74395ad9831dafa4d36d21716 # Public key
Account ID: 0x28340716214bbe2fc67db7eec79ae267cb664fe74395ad9831dafa4d36d21716
SS58 Address: 5CyREBErNFhogptd92dtC8ybuoUczVYh2ijvdhTpS2PJGeq7
Provided 1 Invalid address ,inspect You will be prompted that the address is invalid .
subkey inspect 5GearBErNFhogptd92dtC8ybuoUczVYh2ijvdhTpS2PJGeq7
Output results
Invalid phrase/URI given
About GearFans
Gear It's the computing component of Boca Ecology ,GearFans yes Gear Enthusiast community .
- Official website :Gear Technologies | Smart-Contract Engine for Polkadot
- Twitter:https://twitter.com/gear_techs
- GitHub:Gear Technologies · GitHub
- Discord:https://discord.com/invite/7BQznC9uD9
- Medium:https://medium.com/@gear_techs
- Telegram Group :https://t.me/gear_tech
- Telegram Chinese group :https://t.me/Gear_CN
- Telegram Chinese development group :https://t.me/gear_dev_cn
边栏推荐
- Contrôle de l'exécution du module d'essai par panneau dans Canoe (primaire)
- MySQL实战优化高手02 为了执行SQL语句,你知道MySQL用了什么样的架构设计吗?
- Tianmu MVC audit I
- CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?
- Combined search /dfs solution - leetcode daily question - number of 1020 enclaves
- 简单解决phpjm加密问题 免费phpjm解密工具
- 软件测试工程师发展规划路线
- MySQL实战优化高手03 用一次数据更新流程,初步了解InnoDB存储引擎的架构设计
- C杂讲 浅拷贝 与 深拷贝
- 17 medical registration system_ [wechat Payment]
猜你喜欢

MySQL combat optimization expert 02 in order to execute SQL statements, do you know what kind of architectural design MySQL uses?

Typescript入门教程(B站黑马程序员)

Carolyn Rosé博士的社交互通演讲记录

16 医疗挂号系统_【预约下单】

Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions

Preliminary introduction to C miscellaneous lecture document

Hugo blog graphical writing tool -- QT practice

jar运行报错no main manifest attribute

软件测试工程师必备之软技能:结构化思维

再有人问你数据库缓存一致性的问题,直接把这篇文章发给他
随机推荐
Automation sequences of canoe simulation functions
MySQL combat optimization expert 04 uses the execution process of update statements in the InnoDB storage engine to talk about what binlog is?
MySQL learning diary (II)
docker MySQL解决时区问题
17 medical registration system_ [wechat Payment]
MySQL实战优化高手05 生产经验:真实生产环境下的数据库机器配置如何规划?
South China Technology stack cnn+bilstm+attention
Upload vulnerability
Can I learn PLC at the age of 33
Docker MySQL solves time zone problems
MySQL实战优化高手12 Buffer Pool这个内存数据结构到底长个什么样子?
Hugo blog graphical writing tool -- QT practice
C杂讲 文件 初讲
在CANoe中通过Panel面板控制Test Module 运行(初级)
竞赛vscode配置指南
美新泽西州州长签署七项提高枪支安全的法案
oracle sys_ Context() function
MySQL Real Time Optimization Master 04 discute de ce qu'est binlog en mettant à jour le processus d'exécution des déclarations dans le moteur de stockage InnoDB.
MySQL实战优化高手10 生产经验:如何为数据库的监控系统部署可视化报表系统?
Super detailed steps for pushing wechat official account H5 messages