Risk Warning: Beware of illegal fundraising in the name of 'virtual currency' and 'blockchain'. — Five departments including the Banking and Insurance Regulatory Commission
Information
Discover
Search
Login
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt
BTC
ETH
HTX
SOL
BNB
View Market
Detailed explanation of the wallet specification in Sui cryptography
SophonLabs
特邀专栏作者
2023-02-05 06:30
This article is about 1361 words, reading the full article takes about 2 minutes
This article will help developers understand Sui's security infrastructure and how to develop secure decentralized applications.

Sui follows widely accepted wallet specifications in the cryptocurrency industry, such as BIP-32 (and its variant, SLIP-0010 ), BIP-44, and BIP-39. These specifications have become commonplace in the cryptocurrency industry as a means for users to manage their account keys.

first level title

key derivation scheme

Sui follows BIP-32 to manage wallets that support the ECDSA Secp 256 k 1 signature scheme.

BIP-32 defines a hierarchical deterministic wallet structure to logically associate a set of keys. Grouping keys in this way reduces the overhead of keeping track of a user's large number of private keys. This approach also lets custodians distribute different administrative addresses for each user account under one source of control.

Using BIP-32 to decouple the derivation of the private key from the derivation of the public key realizes the use case of only looking at the wallet, that is, a string of public keys and their addresses can be derived, while the private key can be kept offline for signing.

Sui follows SLIP-0010 to manage wallets that support the Ed 25519 (EdDSA) signature scheme.

Sui used SLIP-0010 because BIP-32 was originally designed for ECDSA with elementary groups, and the Ed 25519 curve is based on groups of h×ℓ, where h is a small coprocessor and ℓ is a 252-bit prime numbers. This is an advanced technical detail, but the Ed 25519 signature standard applies bit clamping to both the low and high bits of the private key, which makes some BIP-32 patterns incompatible with Ed 25519. Therefore, SLIP-0010 prohibits the derivation of a new public key from an existing user's public key. SLIP-0010 only supports the so-called"Reinforced"first level title

key derivation path

While BIP-32 specifies levels of wallets in the hierarchy, BIP-44 further defines five levels of derivation paths and their exact meanings: M/purpose'/coin_type'/account'/change/address_index. In this structure, a slash indicates a new level, or sublevel, in the hierarchy.

The destination layer is usually set to 44, which corresponds to the BIP number. However, in Sui, the destination layer distinguishes between different signature schemes. 44 is set to Ed 25519 and 54 is set to ECDSA Secp 256 k 1 . While it is non-standard to set the intent level to a value other than 44, it is common to use the intent field to differentiate between different signature schemes. For example, BIP-49 and BIP-84 are used to identify Bitcoin's script type. Sui chose 54 to represent ECDSA Secp 256 k 1 because there is no existing BIP under 54 to avoid confusion with any Bitcoin standard.

secondary title

picture

Account levels are often used to logically separate user accounts and create specific account categories. Some common use cases include:

  • Custodians manage multiple user accounts.

  • Users designate accounts for specific purposes, such as donations, savings, and spending.

secondary title

first level title

picture

Mnemonic support

secondary title

Sui's key management

Sui supports key pair generation and associated mnemonics through its Typescript SDK and command line interface (CLI). The SDK provides additional functionality, including transaction signing and RPC integration.

Specific steps are as follows:

  • Deduce a key pair from a mnemonic

  • get its address

  • Use it to sign a serialized typed transaction (or any data)

  • picture

picture

first level title

picture

Advanced Wallet Architecture

A wallet must be secure yet easily accessible to its owner. Sui relies on industry standards to guide the design of user wallets, while remaining agile and flexible when exploring different signature schemes. In addition to the wallet specifications currently supported by Sui, wallet designs are constantly being innovated to make interactions with Sui safer and easier to use. Sui will soon share the design of the wallet pre-approved transactions. Sui Wallet does not need to sign transactions one at a time, but makes on-chain games practical, fully unleashing the potential of fast execution on the Sui network.

Sui
public chain
Developer
wallet
Welcome to Join Odaily Official Community