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

Collateral inputs #2273

Merged
merged 2 commits into from
May 10, 2021
Merged

Collateral inputs #2273

merged 2 commits into from
May 10, 2021

Conversation

nc6
Copy link
Contributor

@nc6 nc6 commented May 6, 2021

This should correspond to the changes made to the spec in #2271.

  • Fee inputs have now been dropped. Fees may be paid from any TxOut,
    including Plutus script addresses, and are included in the main inputs
    as with all previous eras.
  • Instead, we have "collateral" which must be posted with transactions
    spending from script addresses. This collateral is only collected if a
    script fails to validate (e.g. a second phase validation). This
    collateral must be provided by VKey-locked inputs.
  • Two new protocol parameters govern this:
    • The collateral percentage determins the percentage of the fee which
      must be posted as collateral.
    • The max collateral inputs determines the maximum number of inputs
      which must be posted as collateral.
  • The CDDL is now updated in order to reflect that inputs remain at key
    '0'. This is OK because collateral is only required for Plutus locked
    addresses.

The limit on the number of collateral inputs, and the restriction to
VKey addresses, is done in order to bound the amount of work which may
be involved in verifying collateral.

eval (Alonzo.txins @era txb ⊆ dom utxo)
?! BadInputsUTxO (eval (Alonzo.txins @era txb ➖ dom utxo))
eval (inputsAndCollateral ⊆ dom utxo)
?! BadInputsUTxO (eval (inputsAndCollateral ➖ dom utxo))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i missed this check! important : )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the change I made to witsVKeyNeeded was to include the collateral inputs in the set of keys that require signatures, so that signatures are checked for inputsAndCollateral not just inputs
I changed the function to have 2 additional things, that ^^ and reqSignerHashes to avoid the awkward union in the UTXOW rule of the stuff in the Shelley witsVKeyNeeded function and the two additional things

@nc6
Copy link
Contributor Author

nc6 commented May 10, 2021

Thanks for fixing the examples, @JaredCorduan! I'll rebase this on master since it seems to have become outdated.

nc6 and others added 2 commits May 10, 2021 10:34
This should correspond to the changes made to the spec in #2271.

- Fee inputs have now been dropped. Fees may be paid from any TxOut,
  including Plutus script addresses, and are included in the main inputs
  as with all previous eras.
- Instead, we have "collateral" which must be posted with transactions
  spending from script addresses. This collateral is only collected if a
  script fails to validate (e.g. a second phase validation). This
  collateral must be provided by VKey-locked inputs.
- Two new protocol parameters govern this:
  - The collateral percentage determins the percentage of the fee which
    must be posted as collateral.
  - The max collateral inputs determines the maximum number of inputs
    which must be posted as collateral.
- The CDDL is now updated in order to reflect that inputs remain at key
  '0'. This is OK because collateral is only required for Plutus locked
  addresses.

The limit on the number of collateral inputs, and the restriction to
VKey addresses, is done in order to bound the amount of work which may
be involved in verifying collateral.
@nc6 nc6 merged commit bc81dd3 into master May 10, 2021
@iohk-bors iohk-bors bot deleted the nc/collateral branch May 10, 2021 13:37
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.

3 participants