delvingbitcoin

Emulating curve point scalar multiplication with OP_CAT

Emulating curve point scalar multiplication with OP_CAT

Original Postby RobinLinus

Posted on: January 8, 2024 03:46 UTC

Understanding the implementation of cryptographic procedures within a programming context can be complex, but the conversation here sheds light on certain specifics.

The discussion revolves around a two-step procedure that enforces message integrity, with the first step being straightforward in its application. The second step involves utilizing Andrew's CAT trick, which allows for the sighash digest to be pushed onto the stack. This process is contingent upon the signature having an exact length of 64 bytes, thus inherently applying the SIGHASH_ALL constraint.

The crux of the conversation concerns a potential misunderstanding regarding the introduction of a new opcode specifically designed for the secp256k1 curve. However, it is clarified that there is no intention to introduce a new opcode. Instead, the objective is to demonstrate how the OP_CAT operation can simplify scalar multiplication on curve points down to a single subtraction between field elements. This discovery is noteworthy in itself.

Given the existence of the OP_CAT operation, it is estimated that subtraction of field elements could be achieved with fewer than 250 opcodes. This task seems even more feasible when considering the use of kilobytes of Script. As such, the assumption of having op_secp256k1_scalar_sub at one's disposal is deemed fair. This assumption serves as a basis to illustrate the main point being made about the potential simplification of scalar multiplication on elliptic curves, which is significant in the realm of cryptographic operations and efficiencies.