i want to use authority delegation so a user can delegate his tokens and later a transaction can be created to transfer those tokens. can this be done without a smart contract and can the authority be delegated to a publickey that only the app has access to and can perform transactions on the users behalf? if so how would i go about implementing this?
1 Answer
Yes, the delegate can be any Pubkey
, the only requirement to achieve the transfer is for that key to be able to "sign", so adding a signature as an on curve keypair, or signing as a PDA using invoke_signed.
However, it doesn't seem very correct to delegate to anything else than a program as the user does not get any guarantee (the code).
-
when i try to delegate to a non program
PubKey
i get this errorWalletSendTransactionError: failed to send transaction: Transaction simulation failed: This program may not be used for executing instructions
Commented Aug 4, 2022 at 13:59