I often chat with people in the Stellar Slack who want to build something similar to Venmo and they tend to struggle understanding how different concepts apply for what they are trying to do.

For this SBC I'll be working on a set of tutorials to create a complete walk through on how to create an app similar to Venmo using Stellar and include an open source reference architecture that others can use to get started quickly.

In the Stellar universe, an entity like Venmo is called an Anchor. From the Stellar documentation:

Anchors are entities that people trust to hold their deposits and issue credits into the Stellar network for those deposits.

The official documentation to create an anchor suggests two ways to maintain customers accounts. The first one is to maintain a Stellar account for each customer and the second one is to maintain a single account and use the memo field to identify who is the recipient. The documentation then expands on the second method without covering the first one.

In this set of tutorials, I'll maintain a Stellar account for each customer and making it transparent that I am using Stellar. Users will use their twitter handle or something similar to send "dollars" to each other and our back-end will take care of signing transactions on behalf of the customers.

By the end of the series I will have:

  • A React-Native wallet similar(ish) to Venmo released under MIT license.
  • A node server to sign transactions, create and setup accounts.

List of articles for this series:

  • Creating your own Asset: How to create an asset representing fiat and information on trustlines.
  • Understanding multisig: How to manage accounts with a multisig schema and considerations.
  • Using the Stellar-SDK in React-Native: Introduce the Stellar-SDK polyfill and how to display an account data in a RN app.
  • Creating an user signup flow: Very simple user signup flow based in user name. It shows how to setup Stellar account, multisig and trustline schema.
  • Depositing "fiat" into your wallet: A fake implementation in the wallet similar to transferring money from a bank.
  • Showing account transactions: Implements the transaction history in the RN wallet.
  • Sending payments: Flow for doing P2P payments.
  • Cashing out: A fake implementation for transferring money to the bank account

Note: For a production level application using AWS directly instead of Heroku would be a better idea but for this tutorial I'll make some assumptions and then leave notes where things will require better security considerations.

Looking forward to hearing your comments and learning what would you like me to write about with these articles.

As a security issue, wouldn’t you want each user to be signing their own transactions (handling their own secret key)? I like the first approach as well but I think centralizing things with one server signing all transactions could be a big liability

    mikeyrf yes, there are cons and pros of going with this approach, one of the cons is security. I want to talk about it, explore possible ways to deal with this and hopefully bring the community to talk openly how they are dealing with these kind of situations.

    While the ideal scenario would be for people to manage their keys, if we want mass adoption, low level details like this should be transparent for the final user (IMO).

    For example https://satoshipay.io/ did a Lumens give away recently and they restrict how the lumens are used. They use a multisig schema and only allow outgoing payment to writers in their ecosystem. In the "building your own venmo scenario" each account will have just the minimum balance plus a little bit more for transaction but most of the operations will happen in our custom asset representing USD.

    If someone from SatoshiPay reads this, I'd love to learn more about your backend infrastructure and how do you keep accounts secure ?.

    I guess but I wouldn’t underestimate people. Given the number of people that have adopted hardware wallets (like Ledger), I don’t think it’s out of the realm of possibility that everyone end user becomes comfortable signing their own transactions individually. Even if signing ultimately takes the form of entering a 6 digit pin or using your thumbprint on an iPhone

      mikeyrf yes, this is the other option. Ethereum wallets like Cipher or Toshi save the key in the enclave and it has work well for them.

      7 days later
      25 days later

      Hi folks! I wanted to share some progress in the tutorial. As of today, it is 50% done. I just completed a very basic implementation of the backend to support the service.

      I'm trying to keep cognitive overload as low as possible. That's why you will see how it ignores on purpose a bunch of best practices or securities considerations. My goal is to complete the basic first backend + mobile. And then talk about best practices and security, for now I'm leaving notes like "don't do this in production!".

      Here's the link to the tutorial, I'd love to hear your feedback and/or contributions https://blog.abuiles.com/building-your-own-venmo-with-stellar/ ?

      A question to other devs out there, what has been your major frustration when building your solution on top of Stellar? Would you be interested in being part of a weekly (bi-weekly) hangout or something similar to talk about building apps with Stellar? If so, fill this form https://goo.gl/forms/hUN8ScgAA3xqFl093

      P.S I normally hire an editor when working on books but since this is a free tutorial, I'll let the editing to the crowds and friends ?

      Thanks for doing this! I have been looking at trying to do this myself! But glad to see you are going for it! I'll run through your tutorial and give you any feedback I can!

      I would also like to thank you very much. You're really creating some great stuff here. Highly appreciated!

      5 days later
      6 days later

      Quick update, the tutorial is almost finished. The backend and mobile wallet sections are completed. You can find the repos in the tutorial.

      I'll be working this week on best practices and going through edits recommendations.

      I left some things as an exercise to the reader. Hopefully this will help have a better grasp on what's possible with Stellar and how to use the SDK ?

      Demo:

      2 months later

      I haven't had a chance to read through it yet but the UX is amazing. So clear and easy to follow. Well done!

      5 months later

      I was just wondering about "minimum balance on account" whereas transactions will fail when under funded. Any thoughts about/ideas for drip-feeding tiny amounts of xml (like a payroll) to each account - rather than manually crediting one account at a time?

      3 years later

      I am actually building anchor for India. The idea is to create a payment corridor for IN and USA. I am open for chat, if anyone's interested with building this with me 🙂

        a month later

        ShriniketDeshmukh Hi Do you have some time to talk about this. I am also looking for someone to team up with regarding a similar project.

        6 months later