Bitcoin Forum
June 06, 2024, 01:55:52 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 [4]  All
  Print  
Author Topic: Is this BIP65 sample script standard?  (Read 4703 times)
CIYAM (OP)
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
January 03, 2016, 05:23:29 AM
 #61

Strange as the tx 41e834bc7d8266e50d271af204ebfc0ea7db4a204607fbad5bee1bd96fc7c6bb can be found on other testnet3 block explorers.

I am starting to agree that "testnet" is actually not at all useful for testing. Sad

The trouble I'm having with "regtest" is the initial P2SH payment. I am sending to what I think should be a valid testnet/regtest P2SH address 2MyPZMFn1fbyo3udjFQwvutmMheV3t2S1GQ but the payment tx to it looks like this:

Code:
{
    "txid" : "f2c870cda40f8f2134fa6d52ab5629055949f0f7b4e554956934be813dec6807",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "coinbase" : "01660101",
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 50.00000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "02f0d1b577793c518bf5c3b94f6c0a14637b3d883da7e5f80c6511167e1825bdd1 OP_CHECKSIG",
                "hex" : "2102f0d1b577793c518bf5c3b94f6c0a14637b3d883da7e5f80c6511167e1825bdd1ac",
                "reqSigs" : 1,
                "type" : "pubkey",
                "addresses" : [
                    "mioQggSG7tw6M3ixQcvWYWXmcbDEMYBZz7"
                ]
            }
        }
    ]
}

So instead of this:
OP_HASH160 <hash> OP_EQUAL

it has done this:
02f0d1b577793c518bf5c3b94f6c0a14637b3d883da7e5f80c6511167e1825bdd1 OP_CHECKSIG

WTF?

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
sniveling
Sr. Member
****
Offline Offline

Activity: 719
Merit: 250


View Profile
January 03, 2016, 05:48:49 AM
 #62

I sometimes get this error message from webbtc when attempting to use its testnet3 script pages. It seemed to be the most reliable script tool available, but I don't trust it anymore. After you suggested trying alternatives I found 41e834bc7d8266e50d271af204ebfc0ea7db4a204607fbad5bee1bd96fc7c6bb on other testnet3 block explorers.

amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
January 03, 2016, 08:02:17 AM
 #63

I am starting to agree that "testnet" is actually not at all useful for testing. Sad
testnet on https://test.webbtc.com/ is not synchronized.
the last block is 2015-11-10 07:21
CIYAM (OP)
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
January 03, 2016, 08:48:54 AM
Last edit: January 04, 2016, 08:26:27 AM by CIYAM
 #64

Finally I got the regtest version to work!!

Code:
{
    "txid" : "5fcebe8baf36c6936485465dedbc22934e7b29164dc4379bcab5c66b53ba5571",
    "version" : 1,
    "locktime" : 353,
    "vin" : [
        {
            "txid" : "1a0af915d3585fa627927b8d74ebc6b1c15ba01179d25b7ebc0a18bfdb003732",
            "vout" : 0,
            "scriptSig" : {
                "asm" : "304402206a780b785554c3f486a64e734d8cc019baf5e3203a8225894aa207ce5ecedf4902206ac5ed47274f1bb3e8d03fc838ee01a
f158a30197500f7bb554645cbc7ae53e301",
                "hex" : "47304402206a780b785554c3f486a64e734d8cc019baf5e3203a8225894aa207ce5ecedf4902206ac5ed47274f1bb3e8d03fc838ee0
1af158a30197500f7bb554645cbc7ae53e301"
            },
            "sequence" : 4294967294
        },
        {
            "txid" : "d779110252411719dac10d06bba948287a254754d8fd970737350932021e8563",
            "vout" : 0,
            "scriptSig" : {
                "asm" : "3045022100a8f068a234814ff39bed454ba0fcea57542410af4730bbe6ea71cef3fff1bc80022078406403872928398378d05192541
128e5cf069168d03cd03082aef06941014b01",
                "hex" : "483045022100a8f068a234814ff39bed454ba0fcea57542410af4730bbe6ea71cef3fff1bc80022078406403872928398378d051925
41128e5cf069168d03cd03082aef06941014b01"
            },
            "sequence" : 4294967294
        }
    ],
    "vout" : [
        {
            "value" : 50.00000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_HASH160 fda3b60118555482c3463148bf18ff12e1f29c2c OP_EQUAL",
                "hex" : "a914fda3b60118555482c3463148bf18ff12e1f29c2c87",
                "reqSigs" : 1,
                "type" : "scripthash",
                "addresses" : [
                    "2NGNM4erqJ14dNdq5QhJorunWZqPY4danqv"
                ]
            }
        }
    ]
}

And this is the redeem tx (using CLTV):
Code:
{
    "txid" : "7fd77a5f62081e113147a31550b6262febd2e3273165c3fb6a59c814d0a97796",
    "version" : 1,
    "locktime" : 252,
    "vin" : [
        {
            "txid" : "5fcebe8baf36c6936485465dedbc22934e7b29164dc4379bcab5c66b53ba5571",
            "vout" : 0,
            "scriptSig" : {
                "asm" : "30440220429b09433f70c16b26021bd19f71a7d30087c3bbd7e1255cfda7c00fdc126bed02207219634bd0f66eee1b73e60552bbf17
7f278ba856b99100bdc610b5da720168501 02681362f33ab4c48884c5f7f5aaf5011d53f0584cf0b257c6c3aff8b0b08241b3 76a820c775e7b757ede630cd0aa11
13bd102661ab38829ca52a6422ab782862f26864687637576a9145e6199a3c0ad658480247a0f30e314aee23db1eb88ac67017fb17576a9145e6199a3c0ad6584802
47a0f30e314aee23db1eb88ac68",
                "hex" : "4730440220429b09433f70c16b26021bd19f71a7d30087c3bbd7e1255cfda7c00fdc126bed02207219634bd0f66eee1b73e60552bbf
177f278ba856b99100bdc610b5da7201685012102681362f33ab4c48884c5f7f5aaf5011d53f0584cf0b257c6c3aff8b0b08241b34c5e76a820c775e7b757ede630c
d0aa1113bd102661ab38829ca52a6422ab782862f26864687637576a9145e6199a3c0ad658480247a0f30e314aee23db1eb88ac67017fb17576a9145e6199a3c0ad6
58480247a0f30e314aee23db1eb88ac68"
            },
            "sequence" : 0
        }
    ],
    "vout" : [
        {
            "value" : 50.00000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 5e6199a3c0ad658480247a0f30e314aee23db1eb OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a9145e6199a3c0ad658480247a0f30e314aee23db1eb88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "mp7zjTrEszZezRBM1cUmTvaK2zf3MuDAHt"
                ]
            }
        }
    ]
}

The P2SH redeem script is as follows:
Code:
OP_DUP
OP_SHA256
c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646
OP_EQUAL
OP_IF
OP_DROP
OP_DUP
OP_HASH160
5e6199a3c0ad658480247a0f30e314aee23db1eb
OP_EQUALVERIFY
OP_CHECKSIG
OP_ELSE
7f
OP_NOP2
OP_DROP
OP_DUP
OP_HASH160
5e6199a3c0ad658480247a0f30e314aee23db1eb
OP_EQUALVERIFY
OP_CHECKSIG
OP_ENDIF

The two address hashes were intentionally made the same to simplify testing - for practical usage they would be different (one for Alice and one for Bob).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
CIYAM (OP)
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
January 04, 2016, 08:23:55 AM
 #65

The following tx uses the "secret reveal" method which doesn't use the CLTV op so it can be issued as soon as the P2SH address is funded (hence locktime is zero).

Code:
{
    "txid" : "1dc407204055e72bdc2bc9579a8827b89a51e8a677c4d46b7ae1a32a4c2280d9",
    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "e8d0014d1bcefa75df448cd30e0225978bf4efec1c1f44b6763ce671aced6b49",
            "vout" : 0,
            "scriptSig" : {
                "asm" : "3045022100f384542d66de1a19d5b1181b9894e14d44f34b83e9a190c0c43046486fbb2d9e02205bb2b9795e4f35c40aa38275a900c
a01ea5f7d7747fcdb657b0c656a130d20cb01 02681362f33ab4c48884c5f7f5aaf5011d53f0584cf0b257c6c3aff8b0b08241b3 31323334353637383930 76a820
c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f26864687637576a9145e6199a3c0ad658480247a0f30e314aee23db1eb88ac67017fb17576
a9145e6199a3c0ad658480247a0f30e314aee23db1eb88ac68",
                "hex" : "483045022100f384542d66de1a19d5b1181b9894e14d44f34b83e9a190c0c43046486fbb2d9e02205bb2b9795e4f35c40aa38275a90
0ca01ea5f7d7747fcdb657b0c656a130d20cb012102681362f33ab4c48884c5f7f5aaf5011d53f0584cf0b257c6c3aff8b0b08241b30a313233343536373839304c5
e76a820c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f26864687637576a9145e6199a3c0ad658480247a0f30e314aee23db1eb88ac67017
fb17576a9145e6199a3c0ad658480247a0f30e314aee23db1eb88ac68"
            },
            "sequence" : 0
        }
    ],
    "vout" : [
        {
            "value" : 50.00000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 5e6199a3c0ad658480247a0f30e314aee23db1eb OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a9145e6199a3c0ad658480247a0f30e314aee23db1eb88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "mp7zjTrEszZezRBM1cUmTvaK2zf3MuDAHt"
                ]
            }
        }
    ]
}

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
Pages: « 1 2 3 [4]  All
  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!