From 2950e091c09988504f65140bc523006662a98613 Mon Sep 17 00:00:00 2001
From: Nick Guo <1387955+nickguo@users.noreply.github.com>
Date: Fri, 20 Oct 2023 14:04:29 -0700
Subject: [PATCH] Fix typos in documentation for Secp256k1 native program

---
 docs/src/developing/runtime-facilities/programs.md | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/docs/src/developing/runtime-facilities/programs.md b/docs/src/developing/runtime-facilities/programs.md
index 787b6444efc3fe..d53b96abc44b1d 100644
--- a/docs/src/developing/runtime-facilities/programs.md
+++ b/docs/src/developing/runtime-facilities/programs.md
@@ -127,13 +127,13 @@ a count of the following struct serialized in the instruction data:
 
 ```
 struct Secp256k1SignatureOffsets {
-    secp_signature_key_offset: u16,        // offset to [signature,recovery_id,etherum_address] of 64+1+20 bytes
-    secp_signature_instruction_index: u8,  // instruction index to find data
-    secp_pubkey_offset: u16,               // offset to [signature,recovery_id] of 64+1 bytes
-    secp_signature_instruction_index: u8,  // instruction index to find data
+    secp_signature_offset: u16,            // offset to [signature,recovery_id] of 64+1 bytes
+    secp_signature_instruction_index: u8,  // instruction index to find signature
+    secp_pubkey_offset: u16,               // offset to ethereum_address pubkey of 20 bytes
+    secp_pubkey_instruction_index: u8,     // instruction index to find pubkey
     secp_message_data_offset: u16,         // offset to start of message data
     secp_message_data_size: u16,           // size of message data
-    secp_message_instruction_index: u8,    // index of instruction data to get message data
+    secp_message_instruction_index: u8,    // instruction index to find message data
 }
 ```
 
@@ -146,7 +146,7 @@ process_instruction() {
       instructions = &transaction.message().instructions
       signature = instructions[secp_signature_instruction_index].data[secp_signature_offset..secp_signature_offset + 64]
       recovery_id = instructions[secp_signature_instruction_index].data[secp_signature_offset + 64]
-      ref_eth_pubkey = instructions[secp_pubkey_instruction_index].data[secp_pubkey_offset..secp_pubkey_offset + 32]
+      ref_eth_pubkey = instructions[secp_pubkey_instruction_index].data[secp_pubkey_offset..secp_pubkey_offset + 20]
       message_hash = keccak256(instructions[secp_message_instruction_index].data[secp_message_data_offset..secp_message_data_offset + secp_message_data_size])
       pubkey = ecrecover(signature, recovery_id, message_hash)
       eth_pubkey = keccak256(pubkey[1..])[12..]