May 26: Inside Cardstack This Week

CARD Protocol, Card Pay SDK & mobile wallet

Cardstack Team
Cardstack
4 min readMay 26, 2021

--

Token bridge testing

We have begun end-to-end testing for the CARD Protocol on testnet. The Card Pay protocol has smart contracts deployed on both layer 1 and layer 2. It uses a token bridge to coordinate deposits and withdrawals between mainnet and the layer-2 chain.

The current generation of UX for token bridging is quite complicated, as users need to use multiple dApps to bridge and mint tokens for use on the layer-2 chain. In contrast, our protocol provides a uniform workflow-based user interface for users who would like to bridge their own tokens between the two networks. For our mainnet launch, those two networks will be Ethereum mainnet and the xDai chain. As for the testnets, we have chosen Kovan as the Ethereum testnet and Sokol as the xDai testnet. There is an existing bridge that is already deployed for Kovan and Sokol.

Our protocol leverages the Arbitrary Message Bridge (AMB) to facilitate all the steps necessary to lock tokens on layer 1 (stablecoins or reward tokens like CARD), mint tokens on the layer-2 blockchain (using the ERC-677 standard), and deposit those tokens into a depot (a Gnosis Safe smart-contract wallet).

Our engineering team has recorded a screencast of a successful end-to-end test across the Kovan and Sokol testnets that completes the deposit workflow with the correct on-chain transactions in the respective block explorers.

This demo shows a successful end-to-end test of the “Reserve pool deposit” workflow.

Other workflows & gas prices

Work continues on the other workflows that leverage the same Card Pay SDK. All the logic of the smart contracts that is necessary for the creation of prepaid cards has been completed and deployed to the respective testnets.

Once the user experience for the additional workflows is completed, using a similar workflow thread model taken from the Boxel design system, we will be able to open up testing to users in the Cardstack community.

As for gas prices, a gas price oracle will help determine the appropriate gas price to be used on the xDai chain. The gas price is very low, averaging 1 gwei, with the fastest being 5 gwei. Since the xDai chain is denominated in xDAI (a stablecoin), most transactions that are needed for the Card Pay protocol are less than a tiny fraction of a penny. To help with testing these cross-chain bridging and minting operations, we use Kovan ETH to create DAI, which are bridged as the testing stablecoin to back our prepaid balances.

Mobile Wallet

On the mobile wallet front, most of the core capabilities are in place. The team is now adding visual polish (such as sorting, conversion rate display, and decimal-point rounding enhancements) as well as improving the general reliability against the many API endpoints necessary to produce a cohesive experience.

We hope to provide users with a mobile-only view of most of the important assets that they have deposited or earned in the Card Pay protocol, without requiring them to use a dApp. For more complicated workflows, both the dApp and the mobile wallet will have to be used together; the dApp is in charge of providing prompts for complex smart-contract operations, while the wallet is focussed on signing such transactions via an approval step.

We also continue to automate the deployment of the mobile app to the app store, so that new versions of the app can be pushed once the code is checked into our GitHub repository. This provides a more expedient way for us to deploy bug fixes during the mainnet beta period. We will announce the sign-up for the beta program in the near future.

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.