stacksgov / grants-program

Archive of past Stacks Foundation grant applications. Historical record of ecosystem development.
https://stacks.org/grants
141 stars 36 forks source link

Stacks Mate #137

Closed radicleart closed 1 year ago

radicleart commented 3 years ago

Background For period: June/July 2021

Ask: $18,000 (reduced from $25,000 with removal of FeePay / sponsored transaction solution) USD

Introduction

Stacks mate is a straight forward service with one goal - to drive adoption of the Stacks Web Wallet by solving the full stop problem:

I’ve downloaded the Stacks Web Wallet, created an account but how the heck do I get any STX into it to drive transactions and benefit from all the great projects currently emerging.

Stacks Mate will provide two core services...

Stacks Swap

A standard redirect service, following the familiar payment flow model (e.g. Paypal, WorldPay etc), which allows Stacks Apps to spin their users off to Stacks Mate and have them returned to their website with 5 Dollars/Euros/Pounds worth of tokens in their web wallet.

Fee Pay

FeepPay has been removed to reduce the scope of this application

A transaction counter signature service that proxies the transaction broadcast process, adds a fee paying signature and then sends it on to the Stacks Network. Fee Pay does not even require the url redirect that the user encounters - it just serves as a simple proxy service and in this way adds no complexity or barriers to the users journey.

Education

Additionally Stacks Mate will serve guides, explainers videos and a host of educational content and links to like minded products and services.

Research

Customer surveys, conducted using Block Survey, based on experiments using our flagship thisisnumberone project give us cause to believe this project will be a helpful addition to the range of products and service currently emerging in support of the User Owned Internet.

It will give us, and other projects in the Stacks eco-system, a place to send users where they can quickly and easily convert a small amount of money, in their preferred currency, into Stacks tokens - directly in their Stacks web wallet, in order to explore Stacks projects without suffering the pain of signing up through a custodial exchange.

We have in mind targeting not only crypto-natives for this project but also the millions of non-crypto followers that the artists on thisisnumberone are able to reach through their respective followers on social media.

Project Overview

The problem we wish to solve with this application is the full stop problem facing users who want to benefit from projects using the Stacks Web Wallet.

Imagine Winni, a non-crypto long time fan of Cara Delevingne. She has heard about NFTs and ended up at the thisisnumberone site from a link on Cara’s Instagram. She is excited and wants to get one of our limited edition, free Cara NFTs. She clicks a link to get the NFT and is confronted with installation of a browser extension. Unsure, but willing to press on she installs the Wallet and follows the instructions to create an account and log in.

Feeling a real sense of achievement Winni clicks the link to mint her very own edition of this unique and empowering artwork. A message appears;

Insufficient Funds to pay the transaction fees of 0.00018 STX - please go to Binance, set up account by uploading your passport photo, buy some crypto with real money, convert some of it to something called Stacks tokens then figure out, on your own, how on earth you get stacks from Binance into your web wallet.

demoralised and dejected Winni runs screaming for the hills - never to return.

This is what we call the full stop problem. At this point Winnifred’s only option, currently, is to sign up at a custodial crypto exchange. Do full KYC and AML check. Purchase some STX through a very foreign and confusing web interface and then somehow figure out how to send enough STX to her Web Wallet in order to cover the Tx fee.

Our Solution

Service 1: Stacks Swap

Instead of sending Winnifred down the dead end of custodial exchanges we simple continue the flow by redirecting her to Stacks Mate. Winnifred is now continuing her journey in a customary redirect payment flow kind of manner - its not fully familiar but also not completely alien - she has been somewhere like this before with World Pay, Paypal, Square Pay and so on.

Winni clicks the link and is presented with a very simple, clean and focused web page. The page has well designed messaging and a supporting explainer video letting her know exactly what is going on, why and how she is helping to both support the Cara Delevingne - a message provided by the originating web site.

Her STX Address, also provided by the originating web site, is pre-populated into the (google-simple-esq) Input box that sits in the centre of the Stacks Mate page. Below it a gold button with the label “get 2 bucks of Stacks so you can take part in one of the most exciting developments to take place on the web since Tim Berners Lee first thought of it back during the French revolution” or some shorter phrase to that effect!

She goes for it. A modal appears asking for CC/DC details - there is even an option to pay in BTC via Bitcoin or Lightning, Ether and Paypal. She enters the details.

The payment goes through and a Stacks transaction is triggered, transferring the current equivalent in STX to her web wallet address. She is provided a link back to the site from where she came and a (much) less prominent link to the stacks explorer - in case she is interested in that sort of thing.

Winni travels back to the Cara NFT page where she started - and half an hour later - once the transaction confirms, she has enough STX to cover the Tx fee to take ownership of the Cara NFT. She goes to the Lion and Lobster where she tells her friends the epic tale of purchasing this NFT - and shows it to them on her mobile. The next day her friend Jemma, not to be left behind, takes the same epic voyage.

Service 2: Fee Pay

FeePay has been removed to reduce the scope of this application

A subset of the solution just described - the part responsible for broadcasting a stacks transfer to the users wallet is a custodial wallet, sitting behind a secure API gateway, which can also be used to provide counter party signatures. In this scenario we can pay the users transaction fee directly using features already available in the Stacks transaction libraries!

This is well worth ours and other Stacks projects while as the fee is likely to be very low in comparison to the value being transferred by the transaction.

Scope What are the components or technical specs of the project? What will the final deliverable look like? How will you measure success?

The full solution for the 5 Swap service is described since Fee Pay forms a small sub-set of this solution.

Components

The components in a solution for this problem will look as follows.

Screenshot 2021-06-12 at 19 25 32

The client application (out of scope / not part of this application) redirects the user to Stacks Mate. The redirect carries;

Note: The most flexible way to do this is to allow the Wallet install and account creation to take place in either the client app or in Stacks Mate.

The sequence diagram shows the flow of calls and events in this solution.

Screenshot 2021-06-12 at 17 41 47

The application will have the following function - conversion of a small amount of currency to Stacks tokens. This version of the application will support conversion of;

Exchange rates, fiat, btc, eth to stx, are pulled from the Risidio Exchange rates micro-service. This provides a websocket API with caching of rates from various providers - this component has the potential to be developed further in a future grant application as a provider for various oracle services.

Budget and Milestones What grant amount are you seeking? How long will the project take in hours? If more than 20, please break down the project into milestones, with a clear output (e.g., low-fi mockup, MVP with two features) and include the estimated work hours for each milestone.

This application is fairly complex and the Risidio Fee Transfer Gateway is a completely new component. However we are also reusing several components and frameworks that we have built speculatively over the past 18 months. Only by leveraging this work could we deliver an application of this complexity in the time scale suggested. For this reason we are happy to deliver this project for one half of the actual cost.

FeePay has been removed to reduce the scope of this application

Ask: $18,000 (reduced from $25,000 USD after removal of FeePay module)

We will integrate and deliver in the following milestones;

Milestone 1: Infrastructure

Setup up staging and production environments. DNS setup. CI setup

Time: 15 hours

Milestone 2: UI/UX Design

Adobe XD mockups and wireframes of the application

Time: 75 hours

Milestone 3: Risidio Payment Micro Service Integration

Integration of Risidio payment server side micro service that integrates with Opennode and Square Pay

Time: 45 hours

Milestone 4: Risidio Xge Rates Micro Service integration

Integration of Risidio Xge rate caching micro service that integrates with Binance and Shape shift.

Time: 40 hours

Milestone 5: Stacks mate client web app

Implementation of UI/UX design.

Integration with Risidio Pay payment npm module

Integration with Risidio Fee Transfer Gateway micro-service, includes code to handle redirects back to callback urls. (24 hours)

Total Time: 70 hours

Milestone 6: Risidio Fee Transfer Gateway micro-service

This micro-service handles interaction with the blockchain. It maintains a stacks wallet with a small balance that allows it to pay its transaction fees. It communicates with our Fee Transfer Clarity Contract to send Winni her STX tokens.

Total Time: 50 hours

Milestone 7: Risidio Fee Transfer Clarity Contract

This contract delivers Winni her STX. It is comprised of a very simple transfer function that takes the recipients address and amount - the transfer fails if not called from the address of the Fee Transfer Gateway.

Cost estimate includes Clarinet testing and helping Ludo and Clarinet team by providing feedback on Clarinet testing on Microsoft machine.

Total Time: 35 hours

Milestone 8: Video Explainer and Educational Assets

The Stacks Mate application will be accompanied by a video explainer and other content all designed to show Winni how to;

Total Time: 30 hours

Total Costs

Note - FeePay has been removed to reduce the scope of this application - this does not change the overall architecture of the platform

Total Grant Request: Ask: $18,000 USD (@ $50 p.h.)

Team Who is building this? What relevant experience do you bring to this project? Are there skills sets you are missing that you are seeking from the community? Please share links to previous work.

Contributors to this project from Risidio are;

The project will be backed by members of Risidio marketing team.

Risks What dependencies or obstacles do you anticipate? What contingency plans do you have in place?

Technical Risks

Storage of a wallet in a server side component carries a small security risk of a targeted hack. This is mitigated by the small transaction sizes involved.

Commercial Risks

Risk of regulatory violation - re KYC / AML. After seeking legal advice we are confident this idea does not violate current AML / AML5 / KYC regulations.

Community and Supporting Materials Do you have previous projects, code commits, or experiences that are relevant to this application? What community feedback or input have you received? How do you plan to share your plan to the community over time and as the final deliverable?

We have a proven track record of delivering value to the Stacks Community through all our ongoing projects, marketing campaigns and business activities.

We have conducted extensive background research for this project through customer experiments run on our flagship thisisnumberone project. This has been in the form of email and online survey campaigns (using Block Survey).

References

stx-grant-bot[bot] commented 3 years ago

Thanks for submitting a grant proposal. Our team will review your submission and get back to you.

RaffiSapire commented 3 years ago

Hi @radicleart, we discussed at the committee meeting which was Thursday last week. First, we suggest you break up the "Buy with STX" and the "STX Swap" as two separate grants. Our feedback on each:

STX Swap

Fee Pay
A platform where a user leaves CC details which then allows him/her to have transactions sponsored on the fly can make it easier to onboard new users.

radicleart commented 3 years ago

Hi @RaffiSapire - thank you these are really great questions.

I have removed FeePay (see quoted comments above) - it is a smaller service that comes with we estimate about 7K of extra work on top of the main proposal - for STX Swap. The costings have been revised back to 18k.

In answer to your questions..

STX Swap

Fee Pay

This service enables users to interact with the Stacks network in try before you buy type of model. We think this will be very helpful to many projects trying to onboard users into their Stacks applications.

markmhendrickson commented 3 years ago

Please loop me into any planning where you feel I could be helpful re: integration with the Stacks Wallet. This is an important initiative.

radicleart commented 3 years ago

@RaffiSapire - any updates?

RaffiSapire commented 3 years ago

Hi @radicleart, we are happy to approve this grant. Can you please confirm it will be open source? Also, a couple of notes from the committee as pieces to think about (but not gating for this grant)

  1. We suggest you look into the legalities of sponsoring such a service.
  2. Are you sure you want to build this yourself when you could just pay for a service that would not run into the rate limit issue?
  3. If you want to submit the FeePay as another grant we can also discuss this one in parallel.
stx-grant-bot[bot] commented 3 years ago

Congratulations. Your grant is now approved. Please complete the on-boarding link here: https://stacks-grant.netlify.app/onboard?q=c940049454b44e79a7cfd20bed7d9e41

radicleart commented 3 years ago

@RaffiSapire thank you!

In reply..

  1. We did check with Jesse Soslow about the legalities - specifically around AML and AML5 / KYC and understand from his reply that if the amounts are kept small there shouldn't be a problem.
  2. Yes - we think building the exchange rate cache is a good idea as it also enables useful services down the line such as comparison between centralised exchange rates and oracle services.
  3. Thanks - considering FeePay in a parallel application will be really helpful
radicleart commented 3 years ago

Hi @RaffiSapire

Progress on this grant can be found here - (stacksmate)[https://stacksmate.com]

Very happy to report we are now in test phase and the milestones, 1 through 8 are complete with just the following work outstanding.

  1. Testing and roll out the payment options will happen sequentially in the following order...

a. Ethereum b. Square Pay for fiat card payment c. Opennode Bitcoin / Lightning payments via opennode d. paypal my be added in the future

Options will remain disabled until we are happy with the implementation.

We will fund the wallet once testing is complete.

In the meantime all feedback will be very much appreciated.

Mike

markmhendrickson commented 3 years ago

Exciting! I just went to try this but got this error:

image

radicleart commented 3 years ago

Hi Mark yes not quite live so I haven't pushed any stx to the wallet yet! Will keep you posted..

On Fri, 13 Aug 2021, 08:58 Mark Hendrickson, @.***> wrote:

Exciting! I just went to try this but got this error:

[image: image] https://user-images.githubusercontent.com/28991/129324243-a2488c19-aa71-40f2-8be1-04fc1e725adb.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stacksgov/Stacks-Grants/issues/137#issuecomment-898265452, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBORIKXG32QWVZSXII6DGDT4TGDPANCNFSM46X45PNQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

radicleart commented 3 years ago

@RaffiSapire , @markmhx - there is now some STX in the StacksMate wallet.

We are still in beta test - and reaching out to the community / Syvita guild etc for help with the testing - really love to know your thoughts / suggestions for improvements?

Mike

dcdigit commented 3 years ago

@radicleart - nice work. a few comments.

I tested it out yesterday, confirmed my BTC tx confirmed and I checked today and I see the wallet did not receive STX - sent you an email about that with all the TXns.

Also, since I've already got a BTC wallet, I sent BTC to stacksmate to get STX, but given that your audience is not going to have a BTC wallet I would suggest you remove all of those crypto options for acquiring STX.

It will be much simpler for the user who only has a CC if all they see are CC and Paypal.

Cheers!

radicleart commented 3 years ago

@dcdigit - just reimbursed your btc - please see stx tx: 0x64e844d367078606e13cbb7783cd45ceff0d872e91ecd5ad6dfd10eab4493344

I will take your advice and disable Opennode transfers for now.

Thanks, Mike

dcdigit commented 3 years ago

Thank you! The BTC transfer was certainly useful for testing - I avoided the foreign currency transfer fee I would have gotten hit with if I had to use the CC. But, for complete newbies (your target user base) they would be confused by the crypto options.

dcdigit commented 3 years ago

Another thing... I am not sure if this is the right place to discuss specific issues with the code. But, for now, unless you tell me to stop reporting issues here I'll continue. :-)

So, now the STX transaction is on the chain (thank you for sending it manually) I would expect it to appear in the web app, but I don't see any STX transaction even though I am logged into the stacksmate app on that wallet through the Hiro Web Wallet extension.

issue:stacksmate UI missing txn

Cheers!

radicleart commented 3 years ago

Hi @dcdigit - i sent the 2 stx outside of stacksmate - ie not from the stacksmate wallet so I would' expect to see this in your transactions.

I have pushed a fix for the bitcoin/lightning integration issue you found - I'm in the process of testing this.

On having crypto to stx - I prefer to keep this functionality. In the the early days we are targeting bitcoiners and ethereum digital collectibles fans with our forthcoming release of Loopbomb on Stacks. Loopbomb is already quite popular on Open Sea so were hoping to bring some of those guys over and make it easy for them to get STX from the loopbomb account menu by linking through to stacksmate.

Thanks again for your help testing - I'll post back here when I'm confident L/BTC to STX is working smoothly again!

Mike.

radicleart commented 3 years ago

The BTC and Lightning payment issue was down to the client failing to connect to the websocket. OpenNode was correcly calling the stacks mate web hook on detection of the Bitcoin / Lighting transaction the stacks mate server was pushing the OpenNode response to the websocket but this was not firing in the client.

This has been corrected in the client application and tested independently.

The homepage screen the user encounters when not logged in was also improved in this release to display the stacks mate information and a login button to prevent then having to figure out to click login on the navbar.

Thanks to everyone who has reported an issue!

dcdigit commented 3 years ago

Nice work! Thanks for the quick fix.

I understand about the STX being transferred "outside" the app, but the blockchain has the info at this point... couldn't the app discover that the STX was transferred from the stacks-mate principal into the "logged in" wallet address? Or is there a separate database that is mirroring aspects of the chain?

I also agree with you about the flexible options for getting STX - I think newbies might also benefit from this type of tool that embeds a receive address into a website like a tipjar: https://github.com/amorriscode/stx-me (also a STX grants app).

Let me know if I can assist with any other testing.

dcdigit commented 3 years ago

Also of interest, this service MoonPay was sent today via ProductHunt: https://www.producthunt.com/posts/moonpay

radicleart commented 3 years ago

Hey @dcdigit

I've seen MoonPay in the accelerator - very impressive project.

Yes its a good idea to have something to trigger the repay of stx via the stacksmate wallet - this could be linked to the original payment and repair the 'hole' - I'll certainly think about this for future development work on stacksmate.

In answer to your more general question about mirroring blockchain data... our general approach, with stacksmate and more so with our NFT apps, is to store user data (profile info, meta data etc) via gaia storage. Transactional user data - ownership records etc on the chain. Other non user related data - taxonomies, exchange rates, stacks txId / paymentId pairs, etc, behind a micro-service api.

Additionally we mirror on chain state using a readonly cache of NFT contract data. Meaning we can deliver things like fast stateless lucene indexes of meta data and real time marketplace functionality, by connecting the cache to a websocket api for sharing contract state changes across multiple user sessions simultaneously.

One really big positive of this - aside really good ui/ux - is it allows us to build apps which avoid pumping loads of 'destined to fail' transactions into the mempool!

Thanks again for your questions, suggestions and comments.

Mike.

jennymith commented 2 years ago

Hey @radicleart, I hope this grant is going well! I see you're still on M1. How far along do you expect to be before the end of the year?

radicleart commented 2 years ago

Hi @jennymith sorry for the confusion - this service has been up and running since early September. I thought (maybe mistakenly?) that @dcdigit was with the foundation and was signing off? If that was incorrect please let me know what I need to do to submit for closure?

Stacks Mate has been used by a few people but more importantly has provided the basis for new development and innovation. One example is this service is being used in conjunction with our NFT marketplace to secure the public minting function which gives us the ability to do stuff like e.g. per asset based royalties.

I'm also extending Stacks Mate with NFT functionality and integrating it with the NFT marketplace I'm building for Loopbomb, #1 (+ Crash Punks) and Risidio. An idea I'd like to explore soon, is extending Stacks Mate with Catamaran Swaps specifically for selling NFTs for bitcoin directly whilst still linking to NFT transfer. I've been working with others on the new Operable trait which will provide a mechanism for a user to set an approved operator (user or marketplace) which will facilitate lots of new use cases - I am currently deploying contracts on testnet / mainnet which are using this new trait.

dcdigit commented 2 years ago

@radicleart - I'm not a foundation member. I am just an interested onlooker with a little bit of QA experience. I thought I'd take your project for a spin. Cheers!

jennymith commented 2 years ago

Hi @jennymith sorry for the confusion - this service has been up and running since early September. I thought (maybe mistakenly?) that @dcdigit was with the foundation and was signing off? If that was incorrect please let me know what I need to do to submit for closure?

Stacks Mate has been used by a few people but more importantly has provided the basis for new development and innovation. One example is this service is being used in conjunction with our NFT marketplace to secure the public minting function which gives us the ability to do stuff like e.g. per asset based royalties.

I'm also extending Stacks Mate with NFT functionality and integrating it with the NFT marketplace I'm building for Loopbomb, #1 (+ Crash Punks) and Risidio. An idea I'd like to explore soon, is extending Stacks Mate with Catamaran Swaps specifically for selling NFTs for bitcoin directly whilst still linking to NFT transfer. I've been working with others on the new Operable trait which will provide a mechanism for a user to set an approved operator (user or marketplace) which will facilitate lots of new use cases - I am currently deploying contracts on testnet / mainnet which are using this new trait.

Ah that explains it! Thanks for the update. Would love to share a more comprehensive recap of how Stacks Mate has been used with the community. I'll connect with you about this soon.