Skip to main content

Delegated Wallets

Delegated Wallets are primary wallets used across DeCash ecosystem, which can be controlled by traditional Algorand wallets. Technically, the delegated wallet is owned by a single owner wallet, which is a traditional Algorand wallet.

Delegated wallets

DeCash API provides endpoints to create and manipulate Delegated Wallets - virtual multi-purpose wallets controlled by either end users or automated systems. Delegated Wallets abstract the Algorand blockchain from the user completely, providing the following:

  • Same security and control level as native blockchain token with simplified access.
  • DeCash API accepts transactions from and to Delegated Wallets and pays fees in Algo on behalf of users.
  • DeCash API abstracts the DeCash token opt-in procedure and will automatically opt Delegated Wallets in under the hood.

You can find out all methods that allow you to work with Delegated Wallets in the DeCash API docs. A clear distinction should be made between Delegated Wallets and regular Algorand wallets:

DeCash ecosystem

Verifier

To check if transactions groups are of the correct form, calls to the verifier smart contract are included in all transactions that involve delegated wallets.

MainNet:

TestNet:

Use cases

Delegated Wallets should be used for all possible use cases.

  • Making transactions between users.
  • Creating temporary (hot) wallets for accepting purchases in DeCash Tokens (see the guide);
  • Paying to clients (if you are an exchange), which allows to opt-in their wallets automatically;
  • Batching transactions using one-to-many transfers, for instance, to distribute tokens in one batch;
  • Using many-to-one transfers, for instance, to collect tokens from many Delegated Wallets in one batch.

Transferring tokens to a regular Algorand wallet instead of a delegated wallet should be considered as ramping off from DeCash ecosystem, which should not be a usual case. However, when needed, DeCash API still allows to perform such transfers.

Implementation details

On Algorand, Delegated Wallets are implemented as Smart Signatures. It means that there is no smart contract deployed for each new Delegated Wallet, but rather the Delegated Wallet itself is a unique signature having its unique Algorand account address, which defines who and how can control DeCash tokens held at this specific Algorand address.

Simplifying the Algorand-specific concepts, Delegated Wallets can be described by the following scheme:

Delegated wallets

For instance, to transact in DeCash tokens:

  1. The owner of the Delegated Wallet (the "owner") requests a delegated transaction from DeCash API, effectively asking it to pay the Algo fee for this transaction. For instance, this transaction can be a token transfer from their Delegated Wallet to another wallet.
  2. DeCash API sends the Algorand transaction to the owner to sign it.
  3. The owner signs the transaction and then it is send back to DeCash API. The Smart Signature logic will additionally verify the owner and spending conditions.
  4. DeCash API executes the signed transaction (group) in the Algorand network, paying fees in Algo and taking the fee for this transaction in DeCash tokens.
  5. Alternatively, if the user wishes to pay fees in Algo, they can interact with the Delegated Wallet themselves by submitting their transactions directly to the Algorand network. Thus, they don't depend on the DeCash API.

The Smart Signature, defined by a smart contract program, also defines:

  • The Algorand owner account of the Delegated Wallet this signature represents.
  • The logic of the program, allowing only the owner of this Delegated Wallet to manage its assets.
  • The provider's account used to opt in and opt out this Delegated Wallet, specifically to move Algos in and out of this wallet, which is required by Algorand to have it operational.