-
Notifications
You must be signed in to change notification settings - Fork 15
Plutus v3 docs added #128
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
Plutus v3 docs added #128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably remove the benchmark-related changes from this PR and split those to a separate PR. They have nothing to do with the PlutusV3 docs.
} | ||
``` | ||
|
||
- `PlutusV3Script []PlutusData.PlutusV3Script`: This field is a slice of `PlutusV3Script` types. It holds all the Plutus V3 scripts that are required to validate the transaction. These scripts are typically referenced by script hashes within the transaction outputs or inputs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This statement isn't quite true. This can hold V3 scripts that can be used to validate the transaction, but it's far more common for this to be empty and to instead use references to scripts that have been included in the outputs from other TXs
// ... | ||
``` | ||
|
||
This structured approach ensures that all necessary Plutus V3 scripts are correctly bundled with the transaction, enabling successful on-chain validation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As noted above, they usually are not bundled with the transaction that they are validating
|
||
## Adding Plutus V3 Reference Inputs | ||
|
||
The `AddReferenceInputV3` function is used to add a transaction input as a reference input for Plutus V3 scripts. Reference inputs are a key feature of Plutus V3, allowing scripts to inspect the contents of UTxOs without consuming them. This is particularly useful for on-chain governance, oracle data, or any scenario where a script needs to read state without altering it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is most often used to add a reference to a V3 script that was added on-chain in a previous TX
**Parameters:** | ||
|
||
- `stakingCredential []byte`: The staking credential (e.g., stake key hash) to be included in the address. Can be `nil` for base addresses without a staking part. | ||
- `networkId byte`: The network identifier (e.g., `0x00` for testnet, `0x01` for mainnet). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there constants for the testnet vs. mainnet networkId values? Magic numbers are generally a bad idea
Also benchmark tool was removed and moved to another repository https://github.com/MIxAxIM/apollo-testing-suite