1

I know than the first litecoin segwit transaction was put to blockchain in 2017/05/10, and it seem that no signature in witness data, how this transaction signed and verified?

https://chain.so/tx/LTC/ce385e55fb2a73fa438426145b074f08314812fa3396472dc572b3079e26e0f9

{
  "txid": "ce385e55fb2a73fa438426145b074f08314812fa3396472dc572b3079e26e0f9",
  "hash": "5f866ef62ad40b448090c444e86a3848af7626bb4b9108c0a517a05e9a957898",
  "version": 1,
  "size": 3665,
  "vsize": 994,
  "locktime": 1201535,
  "vin": [
    {
      "txid": "6f45775d5f5b62bdd1527151ddb7f6b19a01bbcb6c3ecebf4c581f11851c1e37",
      "vout": 0,
      "scriptSig": {
        "asm": "002091fb57fbeb6404cb412c104fcfb6bbcbe144884135d260879738f34f97d3d0ed",
        "hex": "22002091fb57fbeb6404cb412c104fcfb6bbcbe144884135d260879738f34f97d3d0ed"
      },
      "txinwitness": [
        "4df501ffd8ffe000104a46494600010100000100010000ffdb004300100b0c0e0c0a100e0d0e1211101318291b181616183224261e293b343e3d3a34393841495e50414559463839526f53596164696a693f4f737b72667a5e676965ffdb004301111212181518301b1b30654339436565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565ffc00011080018001803012200021101031101ffc4001800010101010100000000000000000000000004050203ffc400241000010303030403000000000000000000010203040011120521311322518132b1d1ffc400160101010100000000000000000000000000030102ffc4002111000202010402030000000000000000000102000312040511222131235161ffda000c03010002110311003f00f2961695b85c92d5d2385277b5fcd6647d519b290ee63258dd3c5ab99915d7415a9d4a8e762817c80ad391119931db8a1b6dbc47c9200b78346ece53e5f536c9cb9c4c9810e3ea6a39c5a49cb33b94fd52a99fa746d1996032eaddcd441bf24fe6d4a7aa91ab516564010b34ababe44fe71264f49a5a5c5e45a5119a41b5c55f1e0b22797a1018253601ceedfdf3b52958ddce0cbc7d4bb5f6c99bc991ea129d1a8f49c6c02e5ac471ebc5294a94eaecaeb555f507594a0b8cffd94d0402ffd8ffe000104a46494600010102002300230000ffdb004300030202020202030202020303030304060404040404080606050609080a0a090809090a0c0f0c0a0b0e0b09090d110d0e0f101011100a0c12131210130f101010ffc0000b080018001801011100ffc400160001010100000000000000000000000000070608ffc40026100002020201040202030100000000000001020304051106071213210014223115415161ffda0008010100003f00db5cf79edfe5d7f214a9662d6338ae32c3d066a33786d666d27a95165fdc5021fc4b2fe4cdb00ebf64326378ed348b91663a61c56a6024b7f585c56b0f9166ee65ef1206ee276ac77bde86f5f153a63d4cbd819b182d5ecb5de1f98b431d03e601fb989b2c751032b7b9abc87f1566d9562013ad807f887f1f4e78ace986b36ad47895f34e54bc75e533b8b0cc8082d207d92bb04e80dfcadeade3df8fe2b8970ce37869eebe3916dbe47eacceb1cb18080158f6bdcfdd2121b7a07d0dfb07f95c83dfe23cdcdbe6190cbe5a1c5089aa9aed1434ec79d3c0aa180d49e4fd7a1fdfc51ea8f4cafe0e6c8354a598b7c472977f9490615d85ec45bee0d23246bee5aeec3b8aaed95b640d68838c8f2ac159c8ac353ac10414d081e27cbdf92fb9ff000c057bbbbfe7c4ce9d74e6e729c850bf73056f15c571b697241721194bb9cbaa4b472ca8db6485189701cf733689000f7fffd94de001ffd8ffe000104a46494600010100000100010000ffed002c50686f746f73686f7020332e30003842494d040400000000000f1c026e00035246471c02000002000400fffe0018526573697a6564207769746820657a6769662e636f6dffdb0043000503040404030504040405050506070c08070707070f0b0b090c110f1212110f111113161c1713141a1511111821181a1d1d1f1f1f13172224221e241c1e1f1effc0000b080018001801011100ffc4001500010100000000000000000000000000000608ffc4002f100000050106020905000000000000000002030405110100061213141522410717213132343637622542617292ffda0008010100003f00b09d5c113536a8717154525489c1530d34c140401a73ad8975a374f61dd7396e667e46dfa51eb71c628c88c7e0e3988c3db658d2e089d9b53b936aa29524500a1851a58a4230d79d2c12f9fb8cd75bdde97e0db30f97d7cd6353f9eecb9e1999e28b19faaabbfbde809e919bd67c0041ed060ffa18021a7ee11fc6b64b737dc774add1f4bf1ee78bcbebe69e5a39f7e6470cc7dd367aeade89d5b943738a629524500a966946064230d7956c4baafba7b0ed590b31e7e7ebf543d6e38c339f38fc3c113187b2cb5a9bd13537276e6e4c525489c142ca28b0c0401a72a5bfffd94d0602ffd8ffe000104a46494600010100000100010000ffdb0043000c08090b09080c0b0a0b0e0d0c0e121e1412111112251b1c161e2c272e2e2b272b2a3137463b313442342a2b3d533e42484a4e4f4e2f3b565c554c5b464d4e4bffdb0043010d0e0e121012241414244b322b324b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4b4bffc00011080018001803012200021101031101ffc4001a000100020301000000000000000000000000030502040607ffc40029100002010302040505000000000000000001020300041105211213415122313281b11523426182ffc400160101010100000000000000000000000000030102ffc4001b11010101010101010100000000000000000102001103122151ffda000c03010002110311003f00f49bc94ab450ab84329f57603b7eea2e4a730ac3338957d5f7093ee0f9d57eb1793dbdea3b431f04393133e7c595df71f1527d5ad6d95a5bc8f932b0fc416e3e9f3b6f467a4aa7f36fe5e0e9b46d4def1ee20b9e01710c8c0841b15cec452b4747b9824b9338b5447958a8757c90091d3fa036ed4ab1c4eb8e467f2b59ebb04b73a7bc31271873891463257ae2b9cb0d36f25ba9e330b8455ca99d4e19ba64ed9de94ac3e6558b97e92386cb46d2af93588eea480c29962e7c201e98c0f2f6a529566493983ce4277fffd94d0402ffd8ffe000104a46494600010100000100010000ffdb0043000c08090a09070c0a090a0d0c0c0e111d131110101123191b151d2a252c2b292528282e3442382e313f3228283a4e3a3f44474a4b4a2d37515751485642494a47ffdb0043010c0d0d110f1122131322473028304747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747474747ffc00011080018001803012200021101031101ffc4001800010100030000000000000000000000000005020406ffc4002810000103030401020700000000000000000102030400051112133161212241143233515271d1ffc400160101010100000000000000000000000000040205ffc4001c1100020203010100000000000000000000010200030411123121ffda000c03010002110311003f00eeaf3765465fc3c623700f5af9d3d0eea7945d43464a9e752064f959e00ce7ed5ad35b71cba3c8032e29d20027157196cb52e247d12121a6be64fd351f706b0433e458c589001d09ae42d08bc804fa66165bb2a4ac479246e63d2bfcbafdd2a3c52a3796f4000eff0009e39f6a53306f77ac86fba30b994aa382bf372bde6d0a92b322301ac8c2d1c6aec7753966ecb01adb7d3e4f84a48cf1fca52a32b190374a48dfba978f7b15e48075e4a566b4ae338244903731e9473a7b3dd294a7d34a529cac1d9635add34fffd94de001ffd8ffe000104a46494600010100000100010000ffed002c50686f746f73686f7020332e30003842494d040400000000000f1c026e00035246471c02000002000400fffe0018526573697a6564207769746820657a6769662e636f6dffdb0043000503040404030504040405050506070c08070707070f0b0b090c110f1212110f111113161c1713141a1511111821181a1d1d1f1f1f13172224221e241c1e1f1effc0000b080018001801011100ffc4001500010100000000000000000000000000000608ffc4002f100000050106020905000000000000000002030405110100061213141522410717213132343637622542617292ffda0008010100003f00b09d5c113536a8717154525489c1530d34c140401a73ad8975a374f61dd7396e667e46dfa51eb71c628c88c7e0e3988c3db658d2e089d9b53b936aa29524500a1851a58a4230d79d2c12f9fb8cd75bdde97e0db30f97d7cd6353f9eecb9e1999e28b19faaabbfbde809e919bd67c0041ed060ffa18021a7ee11fc6b64b737dc774add1f4bf1ee78bcbebe69e5a39f7e6470cc7dd367aeade89d5b943738a629524500a966946064230d7956c4baafba7b0ed590b31e7e7ebf543d6e38c339f38fc3c113187b2cb5a9bd13537276e6e4c525489c142ca28b0c0401a72a5bfffd94d0602ffd8ffe000104a46494600010100000100010000ffdb004300090606080605090807080a09090a0d160e0d0c0c0d1a131410161f1c21201f1c1e1e2327322a23252f251e1e2b3b2c2f3335383838212a3d413c364132373835ffdb004301090a0a0d0b0d190e0e1935241e243535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535353535ffc00011080018001803012200021101031101ffc40017000101010100000000000000000000000000070604ffc4002910000006010303030501000000000000000102030405110007122106134114317132426191a1b1ffc400160101010100000000000000000000000000010002ffc400161101010100000000000000000000000000000111ffda000c03010002110311003f009d74674c2124a03b92218ed8bc9530b0dff3594f69090aac6081e2582499478299a94777e2fdf38fa4d8a2de3d89fb463b655b24a147c5ed0bfede6c938f4d728a61b4a4bb290390f6e047335a8926a069d25151e3330c4311af0655b88eed803f717cd5f8c650a7e3cedfa5e4127a255514daae613186bb74410a0f9e3194ab180d39d446b18c93869c3188d933ee6ee42c413b1bda6af1622203e2ff005564fa8601361df24bb0edfb89fd512bfdc631a130d4cd4a6d2ec8f0f06615105043d43aa1281c007e82df3560163e6b18c621ffd9696969696969"
      ],
      "sequence": 4294967294
    }
  ],
  "vout": [
    {
      "value": 0.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_RETURN 736567776974",
        "hex": "6a06736567776974",
        "type": "nulldata"
      }
    }
  ]
}
1

sha256 of last element must be 0x91fb57fbeb6404cb412c104fcfb6bbcbe144884135d260879738f34f97d3d0ed

witness contains only one element. let us calculate (long lines stripped):

static void test_litecoin ( )
{
  const MyByteArray witness ( QByteArray::fromHex ( "4df501ffd8f[....]8c621ffd9696969696969" ));
  const MyKey32 sha256 ( witness.sha256 ( ) );
  qDebug ( ) << "sha256=" << sha256.toStringRev ( );
}

The output of my simple program is:

sha256= "91fb57fbeb6404cb412c104fcfb6bbcbe144884135d260879738f34f97d3d0ed"

OK, this is correct. Now execute the script itself. write in console the following command:

decodescript 4df501ffd8f[....]8c621ffd9696969696969

The result is (long lines stripped again):

{
  "asm": "ffd8f[...]fd9 ffd8f[...]fd9 ffd8f[...]fd9 ffd8f[...]fd9 ffd8[...]fd9 ffd8[...]fd9 ffd8[...]fd9 
          OP_VERIFY OP_VERIFY OP_VERIFY OP_VERIFY OP_VERIFY OP_VERIFY",
  "type": "nonstandard",
}

Seven times script pushes some garbage data and six times runs OP_VERIFY. This script evaluates to true

So, spending from the address 32zyb29Yv4TBUnusDDLZ9kLKT55Fs772JW does not require signing. And verifying transaction does not check any ECDSA signatures

  • hi @amaclin why litecoin blockchain can accept this transaction even there is no any signature including in signing process, Does this mean this type transaction is ANY_ONE_CAN_SPEND and how to sign this transaction with bitcoin-cli? I understand below. bob want to pay 1BTC to alice, alice show bob the xxxx= has256(garbage data), and bob send to xxxx, when alice want to redeem this 1 BTC, alice just put garbage data in witness and broadcast it, this is ok. But if the black hat jack also know the garbage data,Does this mean jack also can spend this input without any signature? – kinjia Jun 4 '18 at 14:05
  • The witness script was known only by creator of address 32zyb.... Yes, today this address is ANYONE_CAN_SPEND because anyone can construct the same scriptSig and witness. Any significant amount from it can be redeemed without any additional knowledge. – amaclin Jun 4 '18 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.