0

I'm currently evaluating Stellar for a new project and one of the requirements would be to have a functionality similar to allowance/transferFrom from ERC20 tokens on Ethereum.

Is there a way in Stellar to allow a different account to move a specific asset on my behalf?

1 Answer 1

2

Yes. You can add additional signers to a Stellar account. When you do so, you provide a key weight, which determines what operations they are authorised to sign. For a given transaction, this is done by comparing the sum of the weights of all provided signers against the relevant threshold value set on your account. If the total weight is equal to or greater than the threshold, then the operation is authorised. There are three thresholds, for each of which you can set a different value.

Example: you want a single external signer to be able to move funds on your behalf. The Payment operation that allows funds to be moved is a medium threshold operation. Using the Set Options operation, you might set your medium threshold to 10. Then, using set options again, you add your external signer, with a key weight of 10.

Now that signer is authorised to move funds (as well as perform any other medium threshold operation). They do so by signing a Payment operation, with your account as the transaction source account. If desired, the low and high thresholds could also be set for security, to further constrain the operations available to this signer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.