dfx wallet
Use the dfx wallet command with subcommands and flags to manage the cycles wallets of your identities and to send cycles to the wallets of other account cycles wallet canisters.
The basic syntax for running the dfx wallet commands is:
dfx wallet [option] <subcommand> [flag]
Depending on the dfx wallet subcommand you specify, additional arguments, options, and flags might apply or be required.
To view usage information for a specific dfx wallet subcommand, specify the subcommand and the --help flag.
For example, to see usage information for dfx wallet send, you can run the following command:
dfx wallet send --help
For reference information and examples that illustrate using dfx wallet commands, select an appropriate command.
| Command | Description |
|---|---|
Add a controller using the selected identity’s principal. |
|
Displays the address book of the cycles wallet. |
|
Authorize a custodian by principal for the selected identity’s cycles wallet |
|
Displays the cycles wallet balance of the selected identity. |
|
Displays a list of the selected identity’s cycles wallet controllers. |
|
Displays a list of the selected identity’s cycles wallet custodians. |
|
Deauthorize a cycles wallet custodian using the custodian’s principal. |
|
|
Displays a usage message and the help of the given subcommand(s). |
Returns the name of the cycles wallet if you’ve used the |
|
Removes a specified controller from the selected identity’s cycles wallet. |
|
Sends a specified amount of cycles from the selected identity’s cycles wallet to another cycles wallet using the destination wallet canister ID. |
|
Specify a name for your cycles wallet. |
|
Upgrade the cycles wallet’s Wasm module to the current Wasm bundled with DFX. |
Using your wallet
After you have used the dfx identity deploy-wallet command to create a cycles wallet canister tied to an identity, you can use dfx wallet commands to modify your cycles wallet settings, send cycles to other cycles wallets, and add or remove controllers and custodians.
dfx wallet add-controller
Use the dfx wallet add-controller to add a controller to the wallet. An identity assigned the role of Controller has the most priviledges and can perform the flowing actions on the selected identity’s cycles wallet:
-
Rename the cycles wallet.
-
Add entries to the address book.
-
Add and remove controllers.
-
Authorize and deauthorize custodians.
A controller is also a custodian and can perform the following actions associated with that role:
-
Access wallet information.
-
Send cycles.
-
Forward calls.
-
Create canisters.
Flags
You can use the following optional flags with the dfx wallet add-controller command.
| Flag | Description |
|---|---|
|
Displays usage information. |
|
Displays version information. |
Options
You can use the following options with the dfx canister call command.
| Option | Description |
|---|---|
|
Specifies the network of the controller you want to add. |
Arguments
You can specify the following arguments for the dfx wallet add-controller command.
| Argument | Description |
|---|---|
|
Specifies the principal of the controller to add to the wallet. |
Examples
You can use the dfx wallet add-controller command to add a controller to your wallet. If the controller you want to add is on a different network on the Internet Computer, specify the network using the --network option. For example:
dfx wallet --network=https://192.168.74.4 add-controller hpff-grjfd-tg7cj-hfeuj-olrjd-vbego-lpcax-ou5ld-oh7kr-kl9kt-yae
dfx wallet addresses
Use the dfx wallet addresses command to display the wallet’s address book.The address entries contain the principal and role (Contact, Custodian, or Controller), and might contain a name, and kind (Unknown, User, or Canister) associated with the address.
Flags
You can use the following optional flags with the dfx wallet add-controller command.
| Flag | Description |
|---|---|
|
Displays usage information. |
|
Displays version information. |
Examples
You can use the dfx wallet addresses command to retrieve information on the addresses in your wallet’s address book. For example:
dfx wallet addresses
Id: hpff-grjfd-tg7cj-hfeuj-olrjd-vbego-lpcax-ou5ld-oh7kr-kl9kt-yae, Kind: Unknown, Role: Controller, Name: ic_admin.
Id: e7ptl-4x43t-zxcvh-n6s6c-k2dre-doy7l-bbo6h-ok8ik-msiz3-eoxhl-6qe, Kind: Unknown, Role: Custodian, Name: alice_auth.
dfx wallet authorize
Use the dfx wallet authorize command to authorize a custodian for the wallet. An identity assigned the role of custodian can perform the following actions on the cycles wallet:
-
Access wallet information.
-
Send cycles.
-
Forward calls.
-
Create canisters.
Flags
You can use the following optional flags with the dfx wallet authorize command.
| Flag | Description |
|---|---|
|
Displays usage information. |
|
Displays version information. |
dfx wallet balance
dfx wallet controllers
Use the dfx wallet controllers command to list the principals of the identities that are controllers of the selected identity’s cycles wallet.
Flags
You can use the following optional flags with the dfx wallet controllers command.
| Flag | Description |
|---|---|
|
Displays usage information. |
|
Displays version information. |
Examples
List the controllers of your selected identity’s cycles wallet.
dfx wallet controllers
The information returned should look similar to the following if there are two controllers:
dheus-mqf6t-xafkj-d3tuo-gh4ng-7t2kn-7ikxy-vvwad-dfpgu-em25m-2ae hpnmi-qgxsv-tgecj-hmjyn-gmfft-vbego-lpcax-ou4ld-oh7kr-l3nu2-yae
dfx wallet custodians
Use the dfx wallet custodians command to list the principals of the identities that are custodians of the selected identity’s cycles wallet. Identities that are added as controllers are also listed as custodians.
Flags
You can use the following optional flags with the dfx wallet custodians command.
| Flag | Description |
|---|---|
|
Displays usage information. |
|
Displays version information. |
Examples
List the custodians of your selected identity’s cycles wallet.
dfx wallet custodians
The information returned should look similar to the following if there are two custodians:
dheus-mqf6t-xafkj-d3tuo-gh4ng-7t2kn-7ikxy-vvwad-dfpgu-em25m-2ae hpnmi-qgxsv-tgecj-hmjyn-gmfft-vbego-lpcax-ou4ld-oh7kr-l3nu2-yae
dfx wallet deauthorize
Use the dfx wallet deauthorize command to remove a custodian from the cycles wallet.
| that this will also remove the role of controller if the custodian is also a controller. |
Flags
You can use the following optional flags with the dfx wallet deauthorize command.
| Flag | Description |
|---|---|
|
Displays usage information. |
|
Displays version information. |
dfx wallet name
Use the dfx wallet name command to display the name of the selected identity’s cycles wallet if it has ben set using the dfx wallet set-name command.
dfx wallet remove-controller
Use the dfx wallet remove-controller command to remove a controller of your selected identity’s cycles wallet.
Flags
You can use the following optional flags with the dfx wallet remove-controller command.
| Flag | Description |
|---|---|
|
Displays usage information. |
|
Displays version information. |
dfx wallet send
Use the dfx wallet send command to send cycles from the selected identity’s cycles wallet to another cycles wallet using the destination cycle wallet’s Canister ID.
Flags
You can use the following optional flags with the dfx wallet send command.
| Flag | Description |
|---|---|
|
Displays usage information. |
|
Displays version information. |
Options
You can use the following option with the dfx wallet send command.
| Option | Description |
|---|---|
|
Override the compute network to connect to. By default, the local network is used. A valid URL (starting with |
Arguments
You must specify the following arguments for the dfx wallet send command.
| Argument | Description |
|---|---|
|
Specify the destination cycle wallet using its Canister ID. |
|
Specify the number of cycles to send. |
Examples
Send cycles from the selected identity’s cycles wallet to another cycles wallet.
For example, to send 2,000,000,000 cycles from the cycles wallet of the selected identity, <ic_admin>, to the cycles wallet of the destination identity, <buffy_standard> with a wallet address r7inp-6aaaa-aaaaa-aaabq-cai, run the following command:
dfx wallet send r7inp-6aaaa-aaaaa-aaabq-cai 2000000000
dfx wallet set-name
Use the dfx wallet set-name command to assign a name to the selected identity’s cycles wallet.
Arguments
You must specify the following arguments for the dfx wallet set-name command.
| Argument | Description |
|---|---|
|
Specify a name for the cycles wallet. |