Technical Spec Sheet
Client: Ultrasound Merch
Author(s): FiBo, Pradhumna Pancholi
A. Overview, problem description, summary or abstract
Shopify is the most powerful and robust e-commerce platform, and similar web3 solutions are not mature enough to support all the needs of USM. An interim product or plugin is needed to bridge this web2 platform with web3 tools and wallets and respond to DAO communities' needs. These needs include paying for merchandise with community governance tokens, gating and redeeming physical products with NFTs, automated distribution of royalties and payments to all stakeholders’ wallets, and producing NFT products that allow for future airdrops and document purchases on-chain.
B. Context and Background
Shopify allows the coupon discount method, enabling BC to integrate with the platform. Bankless Checkout was conceived to enable the BanklessDAO community to buy merchandise from USM with governance tokens. Functionality was expanded after the delivery of the first feature. Due to high gas fees on the Ethereum network, there was a need to use a layer 2 solution, and Polygon was presented as a solution.
C. Goals or product and technical requirements
Product requirements in the form of user stories
- As a crypto-native, I want to buy merchandise with the option to pay governance tokens or legacy cryptocurrencies or stables on an L2/side chain so that I can do a faster and cheaper transaction
- As a crypto native, I want to be able to redeem merchandise with Non-Fungible Tokens from artists/communities so that I can get the physical product associated with the NFT
- As a crypto-native, I want to be able to get airdrops from artists and communities so that I can.… (rephrase for NFT Receipt)
- At USM, I want to be able to distribute royalties to all stakeholders' wallets so that I can focus on other aspects of running USM
- As USM, I want to be able to ensure that buyers are not purchasing from compromised wallets so that I can remain compliant with regulations and not put the business at risk
Technical Requirements
- Governance Tokens
- Governance token address
- ERC-20 token needs to be deployed on the Polygon network so that customers don’t have to pay a fraction of the product’s price in transaction fees.
- * To support multiple wallets, we need to use Aragon’s use-wallet, but the current blocker is that we can not use npm packages. (potential solutions in progress)
- NFT Redemption
- NFT address
- Chain id (we use polygon as default now but will need chain id to support this feature on multiple chains)
- Airdrops or NFT receipt
- For retroactive airdrops to show appreciation to the early believers, we can collectively address using Etherscan and perform the airdrop using a tool like Dapple Airdrops.
- Royalty and payment distribution
- We plan to use Superfluid for distributing revenue in streams. This will allow us to avoid paying high transaction fees. In addition, this helps us reduce liability risks for the funds as no funds are locked up in a contract, as revenue keeps flowing to the respective wallets in real time.
- Due to the bridging nature of this project, instead of using smart contracts, we will be using Superfluid’s npm SDK to implement this feature, making it easier to integrate it with Shopify and avoid the overhead of developing an interface(UI) for store admins to manage these streams.
- AML
D. Nongoals or out of scope
- Payment with Multisig wallets
E. Solutions
Current or existing solution/design
Current solution description
Pros and cons of the current solution
Suggested or proposed solution/design
External components that the solution will interact with and that it will alter
Dependencies of the current solution
Pros and cons of the proposed solution
Data Model/Schema Changes
Schema definitions
New data models
Modified data models
Data validation models
Business Logic
API changes
Pseudocode
Flowcharts
Error states
Failure scenarios
- Metamask not installed - “Please install Metamask.”
- Wrong network - “Please switch to the Polygon.”
- NFT Guard - “You have a product in your cart that is only redeemable with respective NFT.”
- Cart without a redeemable product - “You do not have a redeemable product in your cart.”
- Wallet without correct token - “You do not have a token to redeem this product.”
- Already redeemed - “You have already redeemed a product with your token.”
- Failed ERC-20 transaction - “Transaction Failed.”
- Changed email -
- Changed product in cart -
- Transaction Rejected - WIP
- No sufficient funds - WIP
- Not enough gas - WIP
Conditions that lead to errors and failures
Limitations
Presentation layer
User requirements
UX and UX changes
UI and UI changes
Wireframes with descriptions
Links to UI/UX designer’s work
Mobile concerns
UI states
Error handling
Other questions to answer
How will the solution scale?
What are the limitations of the solution?
How will it recover in the event of a failure?
How will it cope with future requirements?
F. Test plan
Explanations of how the tests will make sure user requirements are met
Unit tests
Integrations tests
QA
G. Test plan
G. Monitoring and alerting plan