当前位置:网站首页>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
边栏推荐
- [one click] it only takes 30s to build a blog with one click - QT graphical tool
- Bugku web guide
- Can I learn PLC at the age of 33
- AI的路线和资源
- cmooc互联网+教育
- The underlying logical architecture of MySQL
- docker MySQL解决时区问题
- Vscode common instructions
- Target detection -- yolov2 paper intensive reading
- History of object recognition
猜你喜欢
17 医疗挂号系统_【微信支付】
MySQL的存储引擎
Not registered via @enableconfigurationproperties, marked (@configurationproperties use)
Mexican SQL manual injection vulnerability test (mongodb database) problem solution
[flask] crud addition and query operation of data
Installation de la pagode et déploiement du projet flask
解决在window中远程连接Linux下的MySQL
MySQL实战优化高手03 用一次数据更新流程,初步了解InnoDB存储引擎的架构设计
宝塔的安装和flask项目部署
MySQL combat optimization expert 12 what does the memory data structure buffer pool look like?
随机推荐
What is the current situation of the game industry in the Internet world?
CAPL 脚本对.ini 配置文件的高阶操作
寶塔的安裝和flask項目部署
Competition vscode Configuration Guide
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
South China Technology stack cnn+bilstm+attention
max-flow min-cut
cmooc互联网+教育
Embedded development is much more difficult than MCU? Talk about SCM and embedded development and design experience
docker MySQL解决时区问题
如何让shell脚本变成可执行文件
MySQL storage engine
Const decorated member function problem
CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?
MySQL实战优化高手09 生产经验:如何为生产环境中的数据库部署监控系统?
Set shell script execution error to exit automatically
Vscode common instructions
Contrôle de l'exécution du module d'essai par panneau dans Canoe (primaire)
C miscellaneous shallow copy and deep copy
MySQL combat optimization expert 10 production experience: how to deploy visual reporting system for database monitoring system?