You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: refocus multi-sig page on MultiKeyAccount, remove keyless
- Move MultiKeyAccount to top as the recommended approach
- Demote MultiEd25519Account to legacy/compatibility section
- Remove keyless accounts section (doesn't belong on multi-sig page)
- Update Spanish and Chinese translations accordingly
The Aptos Rust SDK supports advanced account types beyond single-key accounts. This page covers multi-signature accounts that require multiple parties to authorize a transaction, and keyless accounts that authenticate through OpenID Connect (OIDC) providers instead of private keys.
10
+
The Aptos Rust SDK supports multi-signature accounts that require multiple parties to authorize a transaction. This is useful for shared custody, organizational wallets, and governance scenarios where no single party should have unilateral control.
11
11
12
-
## MultiEd25519Account
12
+
## MultiKeyAccount
13
13
14
-
A `MultiEd25519Account` implements an M-of-N threshold signing scheme using Ed25519 keys. This means you define N total signers, and any M of them must sign a transaction for it to be valid. This is useful for shared custody, organizational wallets, and governance scenarios where no single party should have unilateral control.
14
+
A `MultiKeyAccount` implements an M-of-N threshold signing scheme that supports mixed cryptographic key types. You can combine Ed25519, Secp256k1, and Secp256r1 keys in a single account. This is the recommended approach for multi-signature accounts.
15
15
16
16
### Creating a Multi-Signature Account
17
17
18
-
To create a `MultiEd25519Account`, generate the individual Ed25519 key pairs first, then combine their public keys with a signing threshold:
In this example, any two of the three signers can authorize a transaction. The `signatures_required` parameter must be between 1 and the total number of public keys (inclusive).
42
-
43
-
### Signing with a MultiEd25519Account
44
-
45
-
When signing a transaction, you provide the individual signers that will participate. The number of signers must meet or exceed the threshold:
46
-
47
-
```rust
48
-
// Sign with signer_1 and signer_3 (2-of-3 threshold met)
49
-
letsignature=multi_account.sign_with_signers(
50
-
&message,
51
-
vec![&signer_1, &signer_3],
52
-
)?;
53
-
```
54
-
55
-
<Asidetype="note">
56
-
All public keys used in a `MultiEd25519Account` must be Ed25519 keys. If you need to mix different key types, use `MultiKeyAccount` instead.
57
-
</Aside>
58
-
59
-
## MultiKeyAccount
60
-
61
-
A `MultiKeyAccount` extends the multi-signature concept by allowing different cryptographic key types in the same threshold scheme. You can combine Ed25519, Secp256k1, and Secp256r1 keys in a single account. This is useful when signers use different wallet software or hardware with different cryptographic capabilities.
62
-
63
-
### Creating a Mixed-Key Multi-Signature Account
18
+
To create a `MultiKeyAccount`, generate the individual key pairs first, then combine their public keys with a signing threshold:
64
19
65
20
```rust
66
21
useaptos_sdk::account::{
@@ -70,95 +25,68 @@ use aptos_sdk::account::{
70
25
// Generate signers with different key types
71
26
leted25519_signer=Ed25519Account::generate();
72
27
letsecp256k1_signer=Secp256k1Account::generate();
28
+
leted25519_signer_2=Ed25519Account::generate();
73
29
74
-
// Create a 2-of-2 multi-key account with mixed key types
30
+
// Create a 2-of-3 multi-key account with mixed key types
In this example, any two of the three signers can authorize a transaction. The `signatures_required` parameter must be between 1 and the total number of public keys (inclusive). Signers can use any supported key type — Ed25519, Secp256k1, or Secp256r1 — allowing one signer to use a software wallet while another uses a hardware device with different cryptographic capabilities.
44
+
86
45
### Signing with a MultiKeyAccount
87
46
88
-
Similar to `MultiEd25519Account`, you provide the individual signers that will participate:
47
+
When signing a transaction, you provide the individual signers that will participate. The number of signers must meet or exceed the threshold:
89
48
90
49
```rust
50
+
// Sign with ed25519_signer and secp256k1_signer (2-of-3 threshold met)
91
51
letsignature=multi_key_account.sign_with_signers(
92
52
&message,
93
53
vec![&ed25519_signer, &secp256k1_signer],
94
54
)?;
95
55
```
96
56
97
-
The key advantage of `MultiKeyAccount` over `MultiEd25519Account` is flexibility: one signer might use an Ed25519 key stored in a software wallet, while another uses a Secp256k1 key from a hardware device that only supports Bitcoin-style cryptography.
98
-
99
-
## Keyless Accounts
100
-
101
-
Keyless accounts allow users to authenticate with their existing identity provider (such as Google or Apple) instead of managing private keys. Under the hood, the SDK uses OpenID Connect (OIDC) tokens combined with ephemeral key pairs and zero-knowledge proofs to produce valid transaction signatures.
57
+
## MultiEd25519Account (Legacy)
102
58
103
-
<Asidetype="note">
104
-
Keyless accounts require the `keyless` feature flag, which is not enabled by default. Add it to your `Cargo.toml`:
`MultiEd25519Account` exists for compatibility with older accounts on-chain. For new multi-signature accounts, use `MultiKeyAccount` instead — it supports the same Ed25519-only configurations plus mixed key types.
110
61
</Aside>
111
62
112
-
### How Keyless Authentication Works
113
-
114
-
1.**Ephemeral Key Pair** -- The SDK generates a short-lived `EphemeralKeyPair` that is used for signing during a single session.
115
-
2.**OIDC Authentication** -- The user authenticates with their identity provider (Google, Apple, etc.) and receives a JWT token.
116
-
3.**Proof Generation** -- A zero-knowledge proof is generated that links the OIDC identity to the ephemeral key pair without revealing the user's identity on-chain.
117
-
4.**Transaction Signing** -- The ephemeral key pair signs the transaction, and the proof is included in the authenticator.
118
-
119
-
### Creating a Keyless Account
63
+
A `MultiEd25519Account` implements an M-of-N threshold signing scheme restricted to Ed25519 keys only. If you need to interact with an existing on-chain multi-sig account that was created with `MultiEd25519`, you can load it as follows:
<Asidetype="caution"title="External Service Dependency">
140
-
Keyless accounts depend on external OIDC providers and the Aptos pepper and prover services. Your application must handle the OIDC redirect flow and token exchange outside of the SDK. The SDK handles the cryptographic operations once you have a valid JWT token.
141
-
</Aside>
142
-
143
-
For a complete walkthrough of setting up keyless authentication, including the OIDC integration and proof generation, see the [Aptos Keyless guide](/build/guides/aptos-keyless).
144
-
145
-
## Choosing an Account Type
146
-
147
-
The following table compares the available account types to help you select the right one for your use case:
84
+
Signing works the same way as `MultiKeyAccount`:
148
85
149
-
| Account Type | Signers Required | Key Types Supported | Best For |
|`Ed25519Account`| 1 | Ed25519 only | General purpose wallets and applications |
152
-
|`Secp256k1Account`| 1 | Secp256k1 only | Interoperability with Bitcoin/Ethereum tooling |
153
-
|`Secp256r1Account`| 1 | Secp256r1 (P-256) only | WebAuthn, passkeys, and secure hardware enclaves |
154
-
|`MultiEd25519Account`| M-of-N | Ed25519 only | Shared custody with uniform key infrastructure |
155
-
|`MultiKeyAccount`| M-of-N | Ed25519, Secp256k1, Secp256r1 | Shared custody across diverse signer environments |
156
-
|`KeylessAccount`| 1 (OIDC) | Ephemeral + OIDC proof | Consumer applications where users should not manage keys |
157
-
158
-
### Decision Guidelines
159
-
160
-
-**Single user, standard wallet** -- Use `Ed25519Account`. It is the most widely supported and has the best performance.
161
-
-**Cross-chain compatibility** -- Use `Secp256k1Account` if your users come from the Bitcoin or Ethereum ecosystem and already have Secp256k1 keys.
162
-
-**Hardware-backed authentication** -- Use `Secp256r1Account` for passkey and WebAuthn integrations where the private key lives in a secure enclave.
163
-
-**Organizational or shared funds** -- Use `MultiEd25519Account` when all signers use Ed25519 keys, or `MultiKeyAccount` when signers use different key types.
164
-
-**Consumer-facing applications** -- Use `KeylessAccount` to let users sign in with Google, Apple, or other OIDC providers without needing to understand private keys or mnemonics.
86
+
```rust
87
+
// Sign with signer_1 and signer_3 (2-of-3 threshold met)
0 commit comments