Bitcoin Forum
May 28, 2024, 02:32:47 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why are scripts needed in transaction?  (Read 510 times)
rfisher1968 (OP)
Sr. Member
****
Offline Offline

Activity: 319
Merit: 250


View Profile
January 24, 2016, 04:06:43 PM
 #1

In the below transaction I know why the scripts are needed. The question I have is why can't you just do something like:

input_txid + output_txid + HASH160(pubkey) + amount + fee + signature(input_txid + output_txid + HASH160(pubkey) + amount + fee)

Hoping for some input, good or bad.

Code:
#394788

raw: 53230eac52e135d99960da6b88aad87641a022b5e6fb5bda75da7878b3154fef

01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff2a032406061d4d696e656420627920416e74506f6f6c20626a3731e324fd2056a4b87ff012000093f60100ffffffff0100f90295000000001976a91402a61d2066d19e9e2fd348a8320b7ebd4dd3ca2b88ac00000000

{
   "lock_time":0,
   "size":127,
   "inputs":[
      {
         "prev_out":{
            "index":4294967295,
            "hash":"0000000000000000000000000000000000000000000000000000000000000000"
         },
         "script":"032406061d4d696e656420627920416e74506f6f6c20626a3731e324fd2056a4b87ff012000093f60100"
      }
   ],
   "version":1,
   "vin_sz":1,
   "hash":"53230eac52e135d99960da6b88aad87641a022b5e6fb5bda75da7878b3154fef",
   "vout_sz":1,
   "out":[
      {
         "script_string":"OP_DUP OP_HASH160 02a61d2066d19e9e2fd348a8320b7ebd4dd3ca2b OP_EQUALVERIFY OP_CHECKSIG",
         "address":"1F1MAvhTKg2VG29w8cXsiSN2PJ8gSsrJw",
         "value":2500000000,
         "script":"76a91402a61d2066d19e9e2fd348a8320b7ebd4dd3ca2b88ac"
      }
   ]
}
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3402
Merit: 6659


Just writing some code


View Profile WWW
January 24, 2016, 04:11:53 PM
 #2

In the below transaction I know why the scripts are needed. The question I have is why can't you just do something like:

input_txid + output_txid + HASH160(pubkey) + amount + fee + signature(input_txid + output_txid + HASH160(pubkey) + amount + fee)

Hoping for some input, good or bad.

Code:
#394788

raw: 53230eac52e135d99960da6b88aad87641a022b5e6fb5bda75da7878b3154fef

01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff2a032406061d4d696e656420627920416e74506f6f6c20626a3731e324fd2056a4b87ff012000093f60100ffffffff0100f90295000000001976a91402a61d2066d19e9e2fd348a8320b7ebd4dd3ca2b88ac00000000

{
   "lock_time":0,
   "size":127,
   "inputs":[
      {
         "prev_out":{
            "index":4294967295,
            "hash":"0000000000000000000000000000000000000000000000000000000000000000"
         },
         "script":"032406061d4d696e656420627920416e74506f6f6c20626a3731e324fd2056a4b87ff012000093f60100"
      }
   ],
   "version":1,
   "vin_sz":1,
   "hash":"53230eac52e135d99960da6b88aad87641a022b5e6fb5bda75da7878b3154fef",
   "vout_sz":1,
   "out":[
      {
         "script_string":"OP_DUP OP_HASH160 02a61d2066d19e9e2fd348a8320b7ebd4dd3ca2b OP_EQUALVERIFY OP_CHECKSIG",
         "address":"1F1MAvhTKg2VG29w8cXsiSN2PJ8gSsrJw",
         "value":2500000000,
         "script":"76a91402a61d2066d19e9e2fd348a8320b7ebd4dd3ca2b88ac"
      }
   ]
}
Scripts allow you to do other things since they specify how you that output can be spent. Those allow special nonstandard transactions for both experimenting and creating more features.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!