当前位置:网站首页>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
边栏推荐
- CAPL脚本中关于相对路径/绝对路径操作的几个傻傻分不清的内置函数
- MySQL combat optimization expert 05 production experience: how to plan the database machine configuration in the real production environment?
- Retention policy of RMAN backup
- Mexican SQL manual injection vulnerability test (mongodb database) problem solution
- The replay block of canoe still needs to be combined with CAPL script to make it clear
- NLP routes and resources
- Random notes
- 软件测试工程师必备之软技能:结构化思维
- 13 医疗挂号系统_【 微信登录】
- Canoe CAPL file operation directory collection
猜你喜欢
MySQL实战优化高手12 Buffer Pool这个内存数据结构到底长个什么样子?
What is the current situation of the game industry in the Internet world?
A necessary soft skill for Software Test Engineers: structured thinking
Const decorated member function problem
Control the operation of the test module through the panel in canoe (Advanced)
宝塔的安装和flask项目部署
17 医疗挂号系统_【微信支付】
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.
CANoe下载地址以及CAN Demo 16的下载与激活,并附录所有CANoe软件版本
Docker MySQL solves time zone problems
随机推荐
Contest3145 - the 37th game of 2021 freshman individual training match_ C: Tour guide
CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?
The 32 year old programmer left and was admitted by pinduoduo and foreign enterprises. After drying out his annual salary, he sighed: it's hard to choose
软件测试工程师发展规划路线
Implement context manager through with
15 医疗挂号系统_【预约挂号】
在CANoe中通過Panel面板控制Test Module 運行(初級)
C miscellaneous two-way circular linked list
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.
What is the current situation of the game industry in the Internet world?
C miscellaneous dynamic linked list operation
MySQL combat optimization expert 10 production experience: how to deploy visual reporting system for database monitoring system?
MySQL real battle optimization expert 08 production experience: how to observe the machine performance 360 degrees without dead angle in the process of database pressure test?
在CANoe中通过Panel面板控制Test Module 运行(初级)
C miscellaneous lecture continued
Bugku web guide
How to make shell script executable
Preliminary introduction to C miscellaneous lecture document
Not registered via @EnableConfigurationProperties, marked(@ConfigurationProperties的使用)
The replay block of canoe still needs to be combined with CAPL script to make it clear