There's no reason Bob needs to tell the MPC nodes which input of their transaction consumes the zkapp:
pub struct BobRequest {
// TRUNCATED...
/// The index of the input that contains the zkapp being used.
// TODO: we should be able to infer this!
pub zkapp_input: usize,
this is because it's easy to recompute, we can just look for the input that points to the zkapp's transaction id, which is also given in the request (bob_request.zkapp_tx.txid())
BTW this is how Bob computes it:
let zkapp_input = tx
.input
.iter()
.enumerate()
.find(|(_, x)| x.previous_output.txid == txid)
.context("internal error: the transaction does not contain the zkapp being used")?
.0;
There's no reason Bob needs to tell the MPC nodes which input of their transaction consumes the zkapp:
this is because it's easy to recompute, we can just look for the input that points to the zkapp's transaction id, which is also given in the request (
bob_request.zkapp_tx.txid()
)BTW this is how Bob computes it: