Skip to content

Commit

Permalink
Increase size of inputs, outputs and witnesses to uint16 (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dentosal authored Mar 14, 2024
1 parent 3e23614 commit 3f228e7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/identifiers/utxo-id.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Coin ID

Is represented as an _outpoint_: a pair of [transaction ID](./transaction-id.md) as `byte[32]` and output index as a `uint8`.
Is represented as an _outpoint_: a pair of [transaction ID](./transaction-id.md) as `byte[32]` and output index as a `uint16`.

## Message ID

Expand Down
8 changes: 4 additions & 4 deletions src/tx-format/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ Transaction is invalid if:
| name | type | description |
|-----------------------|------------------------------|------------------------------------------------------------------------|
| `txID` | `byte[32]` | Hash of transaction. |
| `outputIndex` | `uint8` | Index of transaction output. |
| `outputIndex` | `uint16` | Index of transaction output. |
| `owner` | `byte[32]` | Owning address or predicate root. |
| `amount` | `uint64` | Amount of coins. |
| `asset_id` | `byte[32]` | Asset ID of the coins. |
| `txPointer` | [`TXPointer`](./tx-pointer.md) | Points to the TX whose output is being spent. |
| `witnessIndex` | `uint8` | Index of witness that authorizes spending the coin. |
| `witnessIndex` | `uint16` | Index of witness that authorizes spending the coin. |
| `predicateGasUsed` | `uint64` | Gas used by predicate. |
| `predicateLength` | `uint64` | Length of predicate, in instructions. |
| `predicateDataLength` | `uint64` | Length of predicate input data, in bytes. |
Expand Down Expand Up @@ -57,7 +57,7 @@ The predicate root is computed [here](../identifiers/predicate-id.md).
| name | type | description |
|---------------|------------------------------|-------------------------------------------------------------------------|
| `txID` | `byte[32]` | Hash of transaction. |
| `outputIndex` | `uint8` | Index of transaction output. |
| `outputIndex` | `uint16` | Index of transaction output. |
| `balanceRoot` | `byte[32]` | Root of amount of coins owned by contract before transaction execution. |
| `stateRoot` | `byte[32]` | State root of contract before transaction execution. |
| `txPointer` | [`TXPointer`](./tx-pointer.md) | Points to the TX whose output is being spent. |
Expand All @@ -79,7 +79,7 @@ Transaction is invalid if:
| `recipient` | `byte[32]` | The address or predicate root of the message recipient. |
| `amount` | `uint64` | Amount of base asset coins sent with message. |
| `nonce` | `byte[32]` | The message nonce. |
| `witnessIndex` | `uint8` | Index of witness that authorizes spending the coin. |
| `witnessIndex` | `uint16` | Index of witness that authorizes spending the coin. |
| `predicateGasUsed` | `uint64` | Gas used by predicate execution. |
| `dataLength` | `uint64` | Length of message data, in bytes. |
| `predicateLength` | `uint64` | Length of predicate, in instructions. |
Expand Down
2 changes: 1 addition & 1 deletion src/tx-format/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Transaction is invalid if:

| name | type | description |
|---------------|------------|------------------------------------------------------------------------|
| `inputIndex` | `uint8` | Index of input contract. |
| `inputIndex` | `uint16` | Index of input contract. |
| `balanceRoot` | `byte[32]` | Root of amount of coins owned by contract after transaction execution. |
| `stateRoot` | `byte[32]` | State root of contract after transaction execution. |

Expand Down
14 changes: 7 additions & 7 deletions src/tx-format/transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ enum ReceiptType : uint8 {
| `scriptLength` | `uint64` | Script length, in instructions. |
| `scriptDataLength` | `uint64` | Length of script input data, in bytes. |
| `policyTypes` | `uint32` | Bitfield of used policy types. |
| `inputsCount` | `uint8` | Number of inputs. |
| `outputsCount` | `uint8` | Number of outputs. |
| `witnessesCount` | `uint8` | Number of witnesses. |
| `inputsCount` | `uint16` | Number of inputs. |
| `outputsCount` | `uint16` | Number of outputs. |
| `witnessesCount` | `uint16` | Number of witnesses. |
| `receiptsRoot` | `byte[32]` | Merkle root of receipts. |
| `script` | `byte[]` | Script to execute. |
| `scriptData` | `byte[]` | Script input data (parameters). |
Expand Down Expand Up @@ -103,12 +103,12 @@ The receipts root `receiptsRoot` is the root of the [binary Merkle tree](../prot
| name | type | description |
|------------------------|-----------------------------|---------------------------------------------------|
| `bytecodeLength` | `uint64` | Contract bytecode length, in instructions. |
| `bytecodeWitnessIndex` | `uint8` | Witness index of contract bytecode to create. |
| `bytecodeWitnessIndex` | `uint16` | Witness index of contract bytecode to create. |
| `policyTypes` | `uint32` | Bitfield of used policy types. |
| `storageSlotsCount` | `uint64` | Number of storage slots to initialize. |
| `inputsCount` | `uint8` | Number of inputs. |
| `outputsCount` | `uint8` | Number of outputs. |
| `witnessesCount` | `uint8` | Number of witnesses. |
| `inputsCount` | `uint16` | Number of inputs. |
| `outputsCount` | `uint16` | Number of outputs. |
| `witnessesCount` | `uint16` | Number of witnesses. |
| `salt` | `byte[32]` | Salt. |
| `policies` | [Policy](./policy.md)`[]` | List of policies. |
| `storageSlots` | `(byte[32], byte[32]])[]` | List of storage slots to initialize (key, value). |
Expand Down

0 comments on commit 3f228e7

Please sign in to comment.