June 16: Inside Cardstack This Week

Card Pay protocol & Card Wallet

Cardstack Team
Cardstack
4 min readJun 16, 2021

--

The Graph for the Card Pay protocol

The Cardstack team has been working on leveraging The Graph, which is a decentralized blockchain query service. The aim is to expose the underlying data model, transaction types, and actors (like customers and merchants) via a custom subgraph that is deployed to The Graph for use by our team as well as other teams seeking to integrate the Card Pay protocol.

Prior to this integration, we were using the Gnosis Transaction Service as well as other APIs from Etherscan and Coingecko to provide data to the wallet and the dApp. One of the use cases that arose was the need to aggregate transactions across many different Gnosis Safes and the user’s own Externally Owned Account (EOA).

By making the Card Pay data model and smart-contract events available as a subgraph, we are able to leverage the power of GraphQL — a query language — to construct a complete transaction history of a user’s wallet, including the underlying multisig Gnosis Safes that are owned by that wallet. This is especially important for prepaid cards, the primary payment methods within Card Pay; they are modeled as Gnosis Safes, which means that prepaid card transactions may get buried in that safe and require a separate app to be displayed.

With this new data access endpoint deployed to The Graph, we are able to connect the mobile wallet’s main transaction history, so it shows a complete history — regardless of whether the transaction is happening through the regular wallet address (EOA) or through one or more safes nested within the wallet. We plan to publish this subgraph for all developers to use, so that other dApps or wallets can report on data models and events of the Card Pay protocol without having to build an additional indexing infrastructure.

Merchant account in the Card Wallet

The Card Wallet is a mobile application that provides a customized view of the unique structure of Card Pay and the actions you can take within the Card Pay ecosystem. We have now added support in the template for displaying another type of safe: a merchant account.

A merchant account is a multisig wallet, which allows merchants to claim the revenue they’ve earned through the network into a Gnosis Safe and then withdraw it from that Gnosis Safe, so they can pay vendors or transfer the funds to other wallets.

We have added a section within the Card Wallet that shows merchants their lifetime earnings through the protocol, their unclaimed revenue that is stored in the revenue pool, and their balances that they have retrieved and stored in this multisig wallet. In effect, we have added an entire multisig wallet infrastructure — customized to the unique needs of merchants — and added it as a component for users who register as merchants and start doing business through the Card Pay protocol.

We plan to add additional merchant-facing capabilities, such as the ability to charge a customer by entering the payment amount and currency, which will generate a QR code for the customer. The customer can then scan that QR code in person to initiate a prepaid card payment to that merchant, which leads to a biometric verification (Face ID / Touch ID) and a layer-2 on-chain confirmation. The design of this workflow and the smart contract for this have been completed; we are awaiting front-end UI development to roll this out to beta users when it is complete.

We are currently preparing the design artifacts to submit the Card Wallet to the Apple app store. We want to enable beta testers to download the iOS wallet to test out the dApp features, because many of the Card Pay dashboard features require the proper configuration of a layer-2 wallet. We will publish a version that does not include all the work-in-progress merchant features, but that does have the necessary Web3 transaction signing and balance display capabilities to support the rollout of new actions and screens in the dApp.

We expect to release new functionalities to coincide with the Web dApp’s capability, so that all of the functions you can currently perform against our command line interface (CLI) and the SDK can be performed by users without technical expertise.

To get all our latest updates, sign up for our newsletter on cardstack.com, star Cardstack on GitHub, and join our Discord channel or our Telegram group and announcement channel.

--

--

Cardstack Team
Cardstack

Official account for the team behind the Cardstack project.