-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a78ea0d
commit 27e0ccd
Showing
9 changed files
with
33,953 additions
and
33,998 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1 @@ | ||
# Accounts | ||
|
||
Accounts is a client library that provides implementations for some common account flavors. Use it to acquire a `Wallet` object that corresponds to an account, and use that together with `@aztec/aztec.js` to interact with the network. | ||
|
||
## Installing | ||
|
||
``` | ||
npm install @aztec/accounts | ||
``` | ||
|
||
## Account types | ||
|
||
- **Schnorr**: Uses an Grumpkin private key with Schnorr signatures for authentication, and a separate Grumpkin private key for encryption. Recommended for most use cases. | ||
- **ECDSA**: Uses an ECDSA private key for authentication, and a Grumpkin private key for encryption. Recommended for building integrations with Ethereum wallets. | ||
- **SingleKey**: Uses a single Grumpkin private key for both authentication and encryption. Recommended for testing purposes only. | ||
|
||
## Usage | ||
|
||
### Deploy a new account | ||
|
||
```typescript | ||
import { getSchnorrAccount } from '@aztec/accounts/schnorr'; | ||
import { GrumpkinPrivateKey } from '@aztec/circuit-types'; | ||
|
||
const encryptionPrivateKey = GrumpkinPrivateKey.random(); | ||
const signingPrivateKey = GrumpkinPrivateKey.random(); | ||
const wallet = getSchnorrAccount(pxe, encryptionPrivateKey, signingPrivateKey).waitDeploy(); | ||
console.log(`New account deployed at ${wallet.getAddress()}`); | ||
``` | ||
|
||
### Create a wallet object from an already deployed account | ||
|
||
```typescript | ||
import { getSchnorrAccount } from '@aztec/accounts/schnorr'; | ||
|
||
const wallet = getSchnorrWallet(pxe, encryptionPrivateKey); | ||
console.log(`Wallet for ${wallet.getAddress()} ready`); | ||
``` | ||
# Account Entrypoints |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.