Closed ooluwati closed 4 years ago
hi @ooluwati,
the monero tip bot doesn't use any database. everything happens on-chain, so does the user management by making use of the wallet features of monero.
a user is basically an account in the wallet. in monero, one account can have many subaddresses, and one wallet can have many accounts. it is like a container within the wallet.
and we are talking about one wallet file here. all telegram users are within one single wallet, separated into accounts. one account for each user.
how do we manage the telegram users? by making use of labels in the monero wallet. an account or subaddress can have a label, with arbitrary content. so I take the username (the @ handle in telegram) and the userID (because usernames can be changed, but not the userID, which is unique) and concatenate them together with an @ sign:
thus a label looks like this username@userid: ooluwati@1234567
as you can see, there is no need for a database. we see the wallet itself as a database.
I'm looking to develop a custom tipbot for a token on Ethereum. I'm first beginning to understand Telegram bots in general, but a still a long ways to go. However, the second step I am unsure of, which is the wallet management system approach in general for telegram users. Are you creating a wallet for each user and storing the credentials in a global telegram database or a personally deployed database? I’m quite stuck on this step. I couldn’t find a component level diagram of how telegram tiptbots are structured, so I am hoping you can give me some insight into this? I didn't know how else to contact you. Thanks in advance.