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 policy #618

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Changes from 3 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
24 changes: 23 additions & 1 deletion src/tx-format/policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ enum PolicyType : uint32 {
WitnessLimit = 2,
Maturity = 4,
MaxFee = 8,
Expiration = 16,
Owner = 32,
}
```

| name | type | description |
|--------|-----------------------------------------------------------------------------------|--------------|
| `data` | One of [`Tip`](#tip), [`WitnessLimit`](#witnesslimit), or [`Maturity`](#maturity) | Policy data. |
| `data` | One of [`Tip`](#tip), [`WitnessLimit`](#witnesslimit), [`Maturity`](#maturity), [`Expiration`](#expiration) or [`Owner`](#owner) | Policy data. |

## `Tip`

Expand Down Expand Up @@ -42,6 +44,16 @@ Transaction is invalid if:

- `blockheight() < maturity`

## `Expiration`

| name | type | description |
|--------------|----------|------------------------------------------|
| `expiration` | `uint32` | Block after which the transaction cannot be included. |

Transaction is invalid if:

- `blockheight() > expiration`

## `MaxFee`

| name | type | description |
Expand All @@ -52,3 +64,13 @@ Transaction is invalid if:

- `max_fee > sum_inputs(tx, BASE_ASSET_ID) - sum_outputs(tx, BASE_ASSET_ID)`
- `max_fee < max_fee(tx, BASE_ASSET_ID, gas_price)`

## `Owner`

| name | type | description |
|---------|----------|----------------------------------------------------------|
| `owner` | `uint64` | Index of the transaction input that we nominate as owner |

Transaction is invalid if:

- `owner >= inputs.len()`
AurelienFT marked this conversation as resolved.
Show resolved Hide resolved
Loading