June 2: Inside Cardstack This Week

Card Pay Protocol, Card Wallet & the Tally analytic model

Cardstack Team
Cardstack
4 min readJun 2, 2021

--

Card Pay Protocol: Off-chain storage

We have completed the development of an off-chain storage approach that will allow us to store additional metadata related to the Card Pay protocol, such as the design of the look and feel of a particular prepaid card or reward card. Our theming system requires the combination of multiple sets of design assets, including background colors, gradients, and textures. This information is not stored on-chain due to cost, but stored off-chain with an on-chain reference to a certain theme ID. The creator of the prepaid card can use our off-chain storage system for authentication, using their wallet address — by signing an EIP-712 message that is then relayed to a hub, which will decode and submit it to one of many off-chain storage mechanisms for insertion or updating. We will leverage this mechanism for the prepaid card creation workflow.

This approach will also be used for off-chain metadata for the Card Commerce protocol (currently in development), encoding information such as product names, photos, descriptions, searchable fields, as well as other correlations with resources on the Web or the decentralized Web. Our approach is agnostic to the exact storage protocol, whether that is cloud storage (like Amazon S3, IPFS, or Filecoin) or permanent storage (like Arweave). We plan to further integrate this off-chain storage protocol with the card compiler work, but we will ship a live version of it along with the Card Pay launch; it will be integrated with the Card Wallet as an authentication and verification source.

Card Wallet: Layer-2 assets

On the mobile development front, work is continuing on the treatment of layer-2 assets. We are making sure that information we can source from public APIs (like Etherscan and Coingecko) is properly reflected in the Card Wallet, be it in numbers or charts. To support multiple layer-2 chains and the assets within, we need to source data, especially around asset prices from data sources that only have information about layer-1 assets.

The CARD Protocol is unique in the way that all the bridged assets (through our token bridge: Card Bridge) are mapped one-to-one to locked assets in the reserve pool on Ethereum mainnet. Therefore, for the purpose of wallet display, we will be using layer-1 asset price histories, exchange rates, and contract address representation whenever those assets are displayed as part of a layer-2 balance. We will explore augmenting this data with other premium data sources (like Zerion) as we continue development.

Protocol Research: Tally analytic model

On the protocol research front, we have reached a milestone in the creation of the Tally analytic model in support of fixed-time-period staking rewards. A staker will receive a proportion of a fixed supply of rewards, based on the number of participants entering and existing within a program of multiple fixed-time periods, e.g. multiple weeks. This mechanism is basically a gas-efficient airdrop scheme that can be even more repeatable than the UNI airdrop and adjusted more dynamically to the level of interest, the number of stakers, and the timing of entries.

One discovery that we made is the use of a maximum reward for each address, so that rewards can be dynamic, while still being capped at a reasonable amount — especially early on in the program when there may be fewer stakers. When more stakers learn about the program and participate, the formula will allocate rewards proportionally, with the option to boost the relative reward ratio based on desirable factors derived from the on-chain activity, time lock, and spam filtering using statistical techniques. This approach produces output that is computed off-chain, which then informs a reward pool smart contract as part of the Card Reward protocol, which will allow stakeholders to claim their rewards in a gas-efficient manner.

Hyperledger presentation

On June 1, Chris Tse spoke at the Hyperledger Media & Entertainment SIG about the “Building Blocks for the New Creator Economy” — if you missed it, you can watch the talk here:

Hyperledger Media and Entertainment SIG hosts Cardstack: Building Blocks for the New Creator Economy

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.