13

What is the correct way to implement a system with one master account that contains sub-accounts associated with individual users? Is it correct to use a Memo for every transaction that then associates funds with a specific user ID (the sub-account)?

The Reddit XLM tip-bot is an example of this account structure. To deposit funds to the tip-bot, you send lumens to the tip-bot's public address with your username as the Memo of the transaction. After depositing, you can then send lumens to any other users within the Stellar subreddit.

1 Answer 1

7

Your question is similar to how the stellar documentation describes customer accounts, which has two recommended methods:

  1. Maintain a Stellar account for each customer. When a customer deposits money with your institution, you should pay an equivalent amount of your custom asset into the customer’s Stellar account from your base account. When a customer needs to obtain physical currency from you, deduct the equivalent amount of your custom asset from their Stellar account.

The functionality you describe the tip bot having actually seems pretty similar to the second method:

  1. Use federation and the memo field in transactions to send and receive payments on behalf of your customers. In this approach, transactions intended for your customers are all made using your base account. The memo field of the transaction is used to identify the actual customer a payment is intended for.

So yes, that seems to be correct.

4
  • 1
    btw, this seems to be the tip bot OP is referencing github.com/shredding/stellar-bot Commented Jan 18, 2018 at 5:04
  • 2
    That is indeed the tip bot I'm referencing, thanks for finding and sharing the repo!
    – Spaceboat
    Commented Jan 18, 2018 at 5:15
  • So in the case of number 1 above, the customer account isn't a special type of account, is it? For example, the"customer account" still has the same minimum balance requirements as a "regular account"?
    – l p
    Commented Feb 11, 2018 at 14:04
  • @lp yes I believe it's just a regular stellar account Commented Feb 11, 2018 at 15:43

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.