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?
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)
It can't be the Plutus context since it doesn't include tx metadata (which we want)
So we have two choices:
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)
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
List of outputs the funds were sent to that contain the stake credential
List of all inputs
Transaction metadata
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
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?
So we have two choices:
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
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