Skip to content

Send: Feature - Nonce assignment on signing for EVM and XRP#2124

Merged
JohnathanWhite merged 4 commits intobitpay:developfrom
leolambo:jitNonceAssignment
Apr 8, 2026
Merged

Send: Feature - Nonce assignment on signing for EVM and XRP#2124
JohnathanWhite merged 4 commits intobitpay:developfrom
leolambo:jitNonceAssignment

Conversation

@leolambo
Copy link
Copy Markdown
Contributor

@leolambo leolambo commented Apr 7, 2026

Description

RN-2649
replaces #2123

EVM and XRP transaction proposals can now have their nonce deferred to signing time. When the app sees a txp with deferNonce set or a null nonce on a nonce-based chain, it calls prepareTx to get a fresh nonce from BWS right before signing. This prevents stale nonces on proposals that sit pending.

Also widens the multi-proposal signing filters so XRP txps go through the sequential path alongside EVM, since they both depend on ordered nonce assignment.

Depends on:

Changelog

  • Added IsNonceChain helper covering EVM + XRP chains
  • publishAndSign calls prepareTx before signing when nonce is missing on a nonce chain
  • Multi-proposal filters use IsNonceChain instead of just IsEVMChain so XRP txps are signed sequentially
  • deferNonce field added to TransactionProposal model

Testing Notes

With deferNonce disabled in runtime settings, behavior should be identical to before — nonces are assigned at creation time.

With deferNonce enabled:

  1. Create an EVM or XRP txp — should have null nonce and deferNonce: true
  2. Sign the txp — app should log prepareTx: BWS assigned nonce X to txp Y before signing
  3. Bulk sign multiple EVM/XRP txps — they should be processed sequentially with incrementing nonces

UTXO chains (BTC, BCH, etc.) are unaffected.

leolambo added 4 commits April 7, 2026 16:18
Call prepareTx instead of assignNonce. Also check for null nonce
as a fallback so the app is ready for when BWS always defers nonce
assignment for EVM chains.
Add IsNonceChain helper that covers EVM + XRP and use it in the
prepareTx guard and multi-proposal signing filters so XRP txps
get the same sequential nonce handling as EVM.
Copy link
Copy Markdown
Collaborator

@gabrielbazan7 gabrielbazan7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code ACK !

@JohnathanWhite JohnathanWhite merged commit e15b104 into bitpay:develop Apr 8, 2026
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

Successfully merging this pull request may close these issues.

3 participants