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

Witnesses for native scripts in reference inputs #631

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Ledger/Conway/Conformance/Utxow.agda
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ data _⊢_⇀⦇_,UTXOW⦈_ where
neededHashes = L.scriptsNeeded utxo txb
txdatsHashes = dom txdats
allOutHashes = L.getDataHashes (range txouts)
nonRefScripts = mapPartial isInj₁ (txscripts tx utxo)
in
∙ ∀[ (vk , σ) ∈ vkSigs ] isSigned vk (txidBytes txid) σ
∙ ∀[ s ∈ mapPartial isInj₁ (txscripts tx utxo) ] validP1Script witsKeyHashes txvldt s
∙ ∀[ s ∈ nonRefScripts ] (hash s ∈ neededHashes → validP1Script witsKeyHashes txvldt s)
∙ L.witsVKeyNeeded utxo txb ⊆ witsKeyHashes
∙ neededHashes \ refScriptHashes ≡ᵉ witsScriptHashes
∙ inputHashes ⊆ txdatsHashes
Expand Down
1 change: 0 additions & 1 deletion src/Ledger/Script.lagda
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ record ScriptStructure : Type₁ where

field hashRespectsUnion :
{A B Hash : Type} → Hashable A Hash → Hashable B Hash → Hashable (A ⊎ B) Hash
⦃ Hash-P1Script ⦄ : Hashable P1Script ScriptHash

field ps : PlutusStructure
open PlutusStructure ps public
Expand Down
3 changes: 2 additions & 1 deletion src/Ledger/Utxow.lagda
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,10 @@ data _⊢_⇀⦇_,UTXOW⦈_ where
neededHashes = scriptsNeeded utxo txb
txdatsHashes = dom txdats
allOutHashes = getDataHashes (range txouts)
nonRefScripts = mapPartial isInj₁ (txscripts tx utxo)
in
∙ ∀[ (vk , σ) ∈ vkSigs ] isSigned vk (txidBytes txid) σ
∙ ∀[ s ∈ mapPartial isInj₁ (txscripts tx utxo) ] validP1Script witsKeyHashes txvldt s
∙ ∀[ s ∈ nonRefScripts ] (hash s ∈ neededHashes → validP1Script witsKeyHashes txvldt s)
∙ witsVKeyNeeded utxo txb ⊆ witsKeyHashes
∙ neededHashes \ refScriptHashes ≡ᵉ witsScriptHashes
∙ inputHashes ⊆ txdatsHashes
Expand Down
Loading