Skip to main content

Crate quai_consensus

Crate quai_consensus 

Source
Expand description

Quai-native transaction encoding and signing; never Ethereum transaction envelopes.

Modules§

document
Bounded transaction interchange with explicit unsigned claims and verified signatures.
proto
Raw prost representation of the pinned transaction wire field numbers. Schema reference: quais.js 94e32c7 / src/encoding/protoc/proto_block.proto. Explicit optional scalar/byte presence is consensus-relevant, including zero. These DTOs are unvalidated. Prefer the bounded encode_proto_transaction and decode_proto_transaction entry points over prost’s unchecked allocation paths. Typed transaction decoding additionally verifies semantics and signatures.

Structs§

AccessTuple
An account and its ordered storage-key access list. Order is preserved.
ConversionSlippage
Explicit slippage in ten-thousandths, restricted to the pinned node’s clamp range.
Denomination
Validated Qi denomination index. Amounts are in Qits (1/1000 Qi).
OutPoint
Unique reference to an existing transaction output.
QiConversionIntent
Explicit Qi-to-Quai destination, refund and slippage intent.
QiConversionTransaction
Immutable unsigned Qi-to-Quai conversion with validated static semantics.
QiInput
An input with a validated public key; construction normalizes SEC1 encoding.
QiOutput
A user-created output. Arbitrary nonzero output locks are deliberately unsupported.
QiTransaction
Unsigned Qi transaction; serialization preserves input/output order.
QiWrappingIntent
Explicit Qi wrapping beneficiary and owner contract intent.
QiWrappingTransaction
Immutable unsigned Qi wrapping with validated static semantics.
QuaiToQiTransaction
Immutable explicit type-0 Quai-to-Qi request. Runtime activation and fee checks remain external.
QuaiTransaction
Unsigned type-0 Quai transaction. Mutation requires a new signature.
SignedQiConversionTransaction
Immutable verified Qi-to-Quai conversion; not a node-acceptance guarantee.
SignedQiTransaction
Immutable signature-verified ordinary Qi transfer. UTXO acceptance still requires a node.
SignedQiWrappingTransaction
Immutable verified Qi wrapping; not a node-acceptance guarantee.
SignedQuaiTransaction
Immutable signed transaction whose sender is recovered from the exact payload.

Enums§

SignedQiOperation
A verified signed operation. Classification never weakens ordinary signing.
TransactionError
Transaction validation errors do not echo transaction data or secret material.

Constants§

KAWPOW_FORK_BLOCK
Prime-block height at which go-quai v0.56.0 changed the k-Quai controller for the KawPow transition, and one of the two heights it holds conversions after.
KQUAI_CHANGE_HOLD_INTERVAL
Length of each of the two hold windows go-quai v0.56.0 implements, about six to seven days of prime blocks. The pinned node’s KQuaiChangeHoldInterval.
MAX_POOL_TRANSACTION_BYTES
Largest signed Quai transaction the pinned node’s pool accepts, its txMaxSize of four 32 KiB slots.
MAX_TRANSACTION_BYTES
Encoded input/output byte ceiling, not a promise that a node accepts this size.
MAX_TRANSACTION_MESSAGES
Total nested-message ceiling, checked before protobuf decoder allocation.
MIN_QUAI_CONVERSION_VALUE
Static minimum value for Quai-to-Qi conversion in the pinned node: 10^19 base units.
SHA_EQUIVALENT_DIFFICULTY_FORK_BLOCK
Prime-block height at which it changed the controller again for SHA-equivalent difficulty. This is also where QiFeeProfile::V056ShaAnchored starts to apply.

Functions§

conversion_batch_discount_bps
Conservative basis points removed by the pinned node’s cubic flow discount from every conversion in one prime-block batch. batch_total is the combined pre-discount Quai value (Its) of all conversions processed up to and including the one being evaluated; flow_amount is the block’s conversion flow amount.
conversion_held
Whether the pinned node refuses conversions at this prime terminus height.
decode_proto_transaction
Decode a bounded canonical protobuf object, preserving explicit field presence. This checks the wire format, not transaction semantics, signatures or spendability. Use document::TransactionDocument::from_proto or a concrete signed type to validate.
encode_proto_transaction
Encode a raw protobuf object within the byte/message policy. This does not establish a valid transaction or authorize submission.
has_transaction_inputs
Whether bytes could be read as a transaction with inputs.

Type Aliases§

U256
Uint for 256 bits.