当前位置:网站首页>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
边栏推荐
- Listen to my advice and learn according to this embedded curriculum content and curriculum system
- Constants and pointers
- 如何让shell脚本变成可执行文件
- Solve the problem of remote connection to MySQL under Linux in Windows
- Tianmu MVC audit I
- Docker MySQL solves time zone problems
- 13 medical registration system_ [wechat login]
- History of object recognition
- Jar runs with error no main manifest attribute
- 16 医疗挂号系统_【预约下单】
猜你喜欢
Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions
MySQL combat optimization expert 02 in order to execute SQL statements, do you know what kind of architectural design MySQL uses?
C杂讲 动态链表操作 再讲
[after reading the series] how to realize app automation without programming (automatically start Kwai APP)
Control the operation of the test module through the panel in canoe (primary)
MySQL storage engine
The underlying logical architecture of MySQL
docker MySQL解决时区问题
Contest3145 - the 37th game of 2021 freshman individual training match_ B: Password
C杂讲 文件 初讲
随机推荐
A necessary soft skill for Software Test Engineers: structured thinking
The 32-year-old fitness coach turned to a programmer and got an offer of 760000 a year. The experience of this older coder caused heated discussion
[NLP] bert4vec: a sentence vector generation tool based on pre training
CAPL script pair High level operation of INI configuration file
Mexican SQL manual injection vulnerability test (mongodb database) problem solution
实现以form-data参数发送post请求
16 medical registration system_ [order by appointment]
MySQL實戰優化高手08 生產經驗:在數據庫的壓測過程中,如何360度無死角觀察機器性能?
If someone asks you about the consistency of database cache, send this article directly to him
如何搭建接口自动化测试框架?
Implement sending post request with form data parameter
Constants and pointers
C杂讲 动态链表操作 再讲
Const decorated member function problem
[one click] it only takes 30s to build a blog with one click - QT graphical tool
Canoe cannot automatically identify serial port number? Then encapsulate a DLL so that it must work
MySQL storage engine
Zsh configuration file
Configure system environment variables through bat script
flask运维脚本(长时间运行)