Skip to content

Commit 36b02bc

Browse files
committed
Update script limits & docs
1 parent 0107cd8 commit 36b02bc

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

packages/cashc/src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const MAX_INPUT_BYTESIZE = 1650;
1+
export const MAX_INPUT_BYTESIZE = 10_000;

website/docs/compiler/script-limits.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,8 @@ Before CashTokens `546` bytes was often used as good default value, however with
7878
For ease of development, it is standard practice to use 1,000 satoshis as dust to outputs.
7979

8080
:::note
81-
The standard practice of 1,000 satoshis as dust amount for outputs is only considering `P2PH`, `P2SH` and `P2PK` output types.
82-
For `P2MS` (raw multisig) a higher dust limits may be required, you can [find more info here][info-dust-limit]
83-
:::
84-
85-
### Output Standardness
86-
87-
Bitcoin Cash only allows a few types of `lockingBytecode` scripts for outputs in the normal network relay rules. These are called 'standard outputs', contrasted to 'non-standard outputs' which cause the transaction not to relay on the network.
88-
89-
There's 4 types of standard output types: `P2PKH`, `P2SH` (which includes `P2SH20` & `P2SH32`), `P2MS` and `OP_RETURN` data-outputs. For more details see the [standard outputs documentation][standard-outputs-docs].
90-
91-
:::caution
92-
The `lockingBytecode` standardness rules can be important for smart contract developers, and is why CashScript has helpers like `LockingBytecodeP2PKH`, `LockingBytecodeP2SH32` and `LockingBytecodeNullData`.
81+
The standard practice of 1,000 satoshis as dust amount for outputs is only considering `P2PKH`, `P2SH20` and `P2SH32` output types.
82+
For other custom locking bytecode outputs a higher dust limits may be required, you can [find more info here][info-dust-limit]
9383
:::
9484

9585
### Minimum Relay Fee
@@ -100,15 +90,15 @@ The Bitcoin Cash protocol does not strictly enforce minimum fees for transaction
10090

10191
| Limit type | Constraint |
10292
|------------|-------------|
103-
| Max contract size | 1,650 bytes (standardness) |
104-
| NFT commitment length | 40 bytes (consensus) |
93+
| Max contract size | 10,000 bytes (consensus) |
94+
| NFT commitment length | 128 bytes (consensus) |
10595
| Operation cost limit | Based on script length (consensus) |
10696
| Max stack element size | 10,000 bytes (consensus) |
10797
| Max transaction size | 100,000 bytes for standardness (1MB for consensus) |
108-
| Max OP_RETURN data size | 220 bytes data payload (standardness) |
98+
| Output locking bytecode size | 201 bytes (standardness) |
99+
| Max OP_RETURN data size | 220 bytes data payload (standardness) |
109100
| Dust threshold | based on output size (standardness) - commonly 1,000 sats is used as dust |
110101
| Minimum relay fee | 1sat/byte (standardness) |
111-
| Output Standardness | `P2PKH`, `P2SH` (incl. `P2SH20` & `P2SH32`), `P2MS` and `OP_RETURN` data-outputs|
112102

113103
For further details on transaction validation and standardness rules, see the [documentation on BCH transaction validation][standardness-docs].
114104

website/docs/sdk/transaction-builder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ transactionBuilder.addOutput(output: Output): this
113113
transactionBuilder.addOutputs(outputs: Output[]): this
114114
```
115115

116-
Adds a single output or a list of outputs to the transaction.
116+
Adds a single output or a list of outputs to the transaction. The `to` field in an output can be a string representing a cash address, or a `Uint8Array` representing a locking bytecode. For `P2PKH`, `P2SH20` and `P2SH32` outputs, it is easiest to use the cash address string. For `P2S` outputs, you need to use the locking bytecode.
117117

118118
```ts
119119
interface Output {

0 commit comments

Comments
 (0)