user2068: What is the meaning of the index in the redeemer ?
redeemer = [ tag: redeemer_tag, index: uint, data: plutus_data, ex_units: ex_units 

for context see:
https://github.com/input-output-hk/cardano-ledger/blob/master/eras/alonzo/test-suite/cddl-files/alonzo.cddl
I think in Serialization version 9 it used to be the index of the inputs. There was even a method for getting the index of the input in the class Transaction Builder. But now in 10.4 this method is not longer available and in fact for the experiments i have done so far the index of the redeemer needed for the transaction to be validated by the node seems not to be the same as the index of the input in the transaction, so I have not a method for computing the index that i should attach to the redeemer.

user7035: I was digging in this topic because I struggled with some transactions. I was reading the CDLL, the serialization lib, docs, etc.. but I couldn't find anything about the meaning of this index.
After some research in the cardano node source code, I found that the index is referred to the TxIn but those must be ordered alphabetical.
Here is some code from the cardano-node:
    scriptWitnessesTxIns
      :: [(TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn era))]
      -> [(ScriptWitnessIndex, AnyScriptWitness era)]
    scriptWitnessesTxIns txins =
        [ (ScriptWitnessIndexTxIn ix, AnyScriptWitness witness)
          -- The tx ins are indexed in the map order by txid
        | (ix, (_, BuildTxWith (ScriptWitness _ witness)))
            <- zip [0..] (orderTxIns txins)
        ]

My problem was that I was using this index according to the add order with the add_plutus_script_input and add_input method.
I hope it helps.

2068: <p>What is the meaning of the index in the redeemer ?</p>
<pre><code>redeemer = [ tag: redeemer_tag, index: uint, data: plutus_data, ex_units: ex_units 
</code></pre>
<p>for context see:</p>
<p><a href="https://github.com/input-output-hk/cardano-ledger/blob/master/eras/alonzo/test-suite/cddl-files/alonzo.cddl" rel="nofollow noreferrer">https://github.com/input-output-hk/cardano-ledger/blob/master/eras/alonzo/test-suite/cddl-files/alonzo.cddl</a></p>
<p>I think in Serialization version 9 it used to be the index of the inputs. There was even a method for getting the index of the input in the class Transaction Builder. But now in 10.4 this method is not longer available and in fact for the experiments i have done so far the index of the redeemer needed for the transaction to be validated by the node seems not to be the same as the index of the input in the transaction, so I have not a method for computing the index that i should attach to the redeemer.</p>
 7035: <p>I was digging in this topic because I struggled with some transactions. I was reading the CDLL, the serialization lib, docs, etc.. but I couldn't find anything about the meaning of this index.</p>
<p>After some research in the cardano node source code, I found that the index is referred to the TxIn but those must be ordered alphabetical.</p>
<p>Here is some code from the cardano-node:</p>
<pre><code>    scriptWitnessesTxIns
      :: [(TxIn, BuildTxWith BuildTx (Witness WitCtxTxIn era))]
      -&gt; [(ScriptWitnessIndex, AnyScriptWitness era)]
    scriptWitnessesTxIns txins =
        [ (ScriptWitnessIndexTxIn ix, AnyScriptWitness witness)
          -- The tx ins are indexed in the map order by txid
        | (ix, (_, BuildTxWith (ScriptWitness _ witness)))
            &lt;- zip [0..] (orderTxIns txins)
        ]
</code></pre>
<p>My problem was that I was using this index according to the add order with the add_plutus_script_input and add_input method.</p>
<p>I hope it helps.</p>
