Skip to content

feat: simplified gift cards#142

Merged
calebjclark merged 1 commit intomainfrom
gc
Nov 17, 2022
Merged

feat: simplified gift cards#142
calebjclark merged 1 commit intomainfrom
gc

Conversation

@blakebyrnes
Copy link
Contributor

@blakebyrnes blakebyrnes commented Nov 17, 2022

NOTE: tests won't run without the @ulixee/payments PR being pulled into main first

This PR converts Databox to use the simplified gift cards scheme. It also adds cli commands to:

  • @ulixee/databox gift-cards create -m 100c -d ./databox.js create a gift card for the existing databox. This process looks up "gift card issuers" installed on the local machine and puts it into a local manifest file for the databox (or uses the existing issuer).
  • @ulixee/databox gift-cards list-issuers should locally installed "issuer identities". Basically the signing proof that this is a real gift card
  • @ulixee/databox gift-cards create-issuer create a new issuer for a gift card (stores in /ulixee/gift-card-issuers

This PR also makes it so a miner does not have to do anything to participate in gift cards. There are two options:

  1. giftCardsAllowed Set to false to disable any gift card usage. It's true by default, but a miner might choose to explicitly turn it off.
  2. giftCardsRequiredIssuerIdentity: An additional security feature requiring a gift card to be signed by both the miner AND the databox in order for the miner to accept it. This would be used if a miner wanted to limit the amount of gift cards a databox author gave out

@calebjclark calebjclark merged commit eb6fe96 into main Nov 17, 2022
@calebjclark calebjclark deleted the gc branch November 17, 2022 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments