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

Add "owner" to transaction policies #617

Open
AurelienFT opened this issue Nov 17, 2024 · 0 comments
Open

Add "owner" to transaction policies #617

AurelienFT opened this issue Nov 17, 2024 · 0 comments

Comments

@AurelienFT
Copy link
Contributor

AurelienFT commented Nov 17, 2024

Background:

Currently, each transaction can have many inputs with different owners. We currently have no way to have a "owner" and multiple implicit rules are used in the ecosystem.

Proposal:

To give information about a potential "owner" we propose to add a new transaction policy. This new policy would specify an index that will indicate which input of the transaction is considered as the "owner" of the transaction . This feature would enable developers to identify an initiator of the transaction.

Implementation Details:

Add a new optional field owner to the transaction structure.
Update the transaction validation logic to check that the index in the owner field exists in the transaction.

Example:

A transaction with the following policy:

inputs :

[
    Input::coin_predicate(
            UtxoId::new([0xaa; 32].into(), 0),
            [0xbb; 32].into(),
            Word::MAX,
            [0xcc; 32].into(),
            TxPointer::new(0x3802.into(), 0x28),
            Word::MAX,
            vec![0xdd; 50],
            vec![],
    ),
]

owner: 0

This transaction will provide the sender of the input 0 as the owner of the tx ([0xbb; 32]) and will be accessible in the code executed in this transaction

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

No branches or pull requests

1 participant