diff --git a/web3.js/src/ed25519-program.ts b/web3.js/src/ed25519-program.ts index b990a06ab7..4e201a8319 100644 --- a/web3.js/src/ed25519-program.ts +++ b/web3.js/src/ed25519-program.ts @@ -94,7 +94,11 @@ export class Ed25519Program { const instructionData = Buffer.alloc(messageDataOffset + message.length); - const index = instructionIndex != null ? instructionIndex : 0; + const index = + instructionIndex == null + ? 0xffff // An index of `u16::MAX` makes it default to the current instruction. + : instructionIndex; + ED25519_INSTRUCTION_LAYOUT.encode( { numSignatures,