Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cardano transfer CDE #262

Closed
SebastienGllmt opened this issue Dec 5, 2023 · 1 comment
Closed

Cardano transfer CDE #262

SebastienGllmt opened this issue Dec 5, 2023 · 1 comment
Assignees

Comments

@SebastienGllmt
Copy link
Contributor

SebastienGllmt commented Dec 5, 2023

Expected use-case: detect if somebody sent ADA to us to buy something in the game. Use tx metadata / datum to specify what they are buying

This CDE takes in a payment credential (could be a payment key hash, could be a script hash) and monitors all ADA sent to that credential.

The main question is: what data does Paima get to see when it happens?

  1. It can't just be the tx cbor, because then you don't know the context of the inputs (other than tx hash and id)
  2. It can't be the Plutus context since it doesn't include tx metadata (which we want)

So we have two choices:

  1. Give the entire tx context + extra information about the tx inputs (in Carp these are two separate queries, but we'd have to modify the tx history endpoint to give both at once)
  2. Give some subset of the tx info that we deem sufficient

Picking (2) maybe is useful for most basic case possible for people who don't want to deal with the complexity of (1). In which case, I would give the following:

Update to the state machine should see the full transaction CBOR from Cardano. The reason I think we have to do this (instead of providing a simpler interface) is because a lot of use-cases may want

  1. List of outputs the funds were sent to that contain the stake credential
  2. List of all inputs
  3. Transaction metadata
  4. Output datum for the UTXO created (hash or inline)

One thing mentioned by Eugene is that we can actually remove "list of inputs" from the requirements if we have users specify the address to credit the data to in the game as part of the metadata (which we probably want for a lot of cases anyway)

Important note: there may be multiple outputs with the same address in the transaction, so this CDE should not run "per output", but rather once for the transaction in general

@SebastienGllmt
Copy link
Contributor Author

See #280

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

No branches or pull requests

2 participants