mirror of
				https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line.git
				synced 2025-11-03 20:07:46 +00:00 
			
		
		
		
	Update 8_2_Building_a_Bitcoin_Script_with_P2SH.md
This commit is contained in:
		
							parent
							
								
									12f31731d7
								
							
						
					
					
						commit
						5f3edc5048
					
				@ -13,11 +13,11 @@ In [§7.2: Running a Bitcoin Script](7_2_Running_a_Bitcoin_Script.md), we offere
 | 
				
			|||||||
To lock this transaction do the following:
 | 
					To lock this transaction do the following:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1. Serialize `OP_ADD 99 OP_EQUAL` (`<serialized99Equal>`) then SHA-256 and RIPEMD-160 hash it (`<hashed99Equal>`).
 | 
					1. Serialize `OP_ADD 99 OP_EQUAL` (`<serialized99Equal>`) then SHA-256 and RIPEMD-160 hash it (`<hashed99Equal>`).
 | 
				
			||||||
   *. OP_ADD = 0x93
 | 
					  1. OP_ADD = 0x93
 | 
				
			||||||
   *. 99 = 0x01, 0x63, the first to push one byte onto the stack, the second as the hex translation of 99
 | 
					  2. 99 = 0x01, 0x63, the first to push one byte onto the stack, the second as the hex translation of 99
 | 
				
			||||||
   *. OP_EQUAL = 0x87
 | 
					  3. OP_EQUAL = 0x87
 | 
				
			||||||
   *. `<serialized99Equal>` = "93016387" 
 | 
					  4. `<serialized99Equal>` = "93016387" 
 | 
				
			||||||
   *. `<hashed99Equal>` = "3f58b4f7b14847a9083694b9b3b52a4cea2569ed"
 | 
					  5. `<hashed99Equal>` = "3f58b4f7b14847a9083694b9b3b52a4cea2569ed"
 | 
				
			||||||
2. Save `<serialized99Equal>` for future reference as the `redeemScript`.
 | 
					2. Save `<serialized99Equal>` for future reference as the `redeemScript`.
 | 
				
			||||||
3. Produce a P2SH locking script that includes the hashed script (`OP_HASH160 <hashed99Equal> OP_EQUAL`).
 | 
					3. Produce a P2SH locking script that includes the hashed script (`OP_HASH160 <hashed99Equal> OP_EQUAL`).
 | 
				
			||||||
4. Create a transaction using that `scriptPubKey`.
 | 
					4. Create a transaction using that `scriptPubKey`.
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user