Bitcoin Forum
May 04, 2024, 10:23:56 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: CHECKLOCKTIMEVERIFY in P2SH  (Read 981 times)
sonicskye (OP)
Jr. Member
*
Offline Offline

Activity: 41
Merit: 2


View Profile WWW
December 23, 2015, 10:52:08 PM
 #1

Hi all,

I tried to construct P2SH script utilizing CHECKLOCKTIMEVERIFY (BIP065) using the following skeleton
Quote
    IF
        SHA256 <secret key> EQUALVERIFY
        <PKI2 pubkey> CHECKSIG
    ELSE
        <expiry time> CHECKLOCKTIMEVERIFY DROP
        <PKI1> CHECKSIG
    ENDIF

The tx is here https://blockchain.info/tx/541ed46b7ec371524eeb08339fbf3b308ae4e6312beaceece884d6d2d8f7e702
And the redeem tx is here https://blockchain.info/tx/24a44ba982e4be2865c3c84fc408079871b49baa0d8a185ce45781228e8ae56e trying to redeem using the ELSE condition.
The problem is that the redeem tx has not been confirmed despite it has been around 10 hrs and it has a proper tx fee. I set the <expiry time> to 389820 whereas 389820 was the future block height, but it is now 389881 and the tx is not yet confirmed.

I wonder if there is something wrong with my txs. Thanks.
1714861436
Hero Member
*
Offline Offline

Posts: 1714861436

View Profile Personal Message (Offline)

Ignore
1714861436
Reply with quote  #2

1714861436
Report to moderator
1714861436
Hero Member
*
Offline Offline

Posts: 1714861436

View Profile Personal Message (Offline)

Ignore
1714861436
Reply with quote  #2

1714861436
Report to moderator
1714861436
Hero Member
*
Offline Offline

Posts: 1714861436

View Profile Personal Message (Offline)

Ignore
1714861436
Reply with quote  #2

1714861436
Report to moderator
The block chain is the main innovation of Bitcoin. It is the first distributed timestamping system.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714861436
Hero Member
*
Offline Offline

Posts: 1714861436

View Profile Personal Message (Offline)

Ignore
1714861436
Reply with quote  #2

1714861436
Report to moderator
1714861436
Hero Member
*
Offline Offline

Posts: 1714861436

View Profile Personal Message (Offline)

Ignore
1714861436
Reply with quote  #2

1714861436
Report to moderator
1714861436
Hero Member
*
Offline Offline

Posts: 1714861436

View Profile Personal Message (Offline)

Ignore
1714861436
Reply with quote  #2

1714861436
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
December 23, 2015, 11:07:40 PM
 #2

The nSequence field of the input looks like it is 0xffffffff. You will need to change that to something else otherwise the transaction will not be accepted. Resend the transaction but with the proper nSequence.

sonicskye (OP)
Jr. Member
*
Offline Offline

Activity: 41
Merit: 2


View Profile WWW
December 23, 2015, 11:12:56 PM
 #3

The nSequence field of the input looks like it is 0xffffffff. You will need to change that to something else otherwise the transaction will not be accepted. Resend the transaction but with the proper nSequence.

Do you mean nSequence field of the redeem tx?
sonicskye (OP)
Jr. Member
*
Offline Offline

Activity: 41
Merit: 2


View Profile WWW
December 24, 2015, 02:50:56 AM
 #4

The nSequence field of the input looks like it is 0xffffffff. You will need to change that to something else otherwise the transaction will not be accepted. Resend the transaction but with the proper nSequence.

Hi knightdk, I have created another tx with different nsequence but I don't think it works https://blockchain.info/tx/b2bab79aeca10f2f65d28a83925ed06383850cf325adca0ef64602f6f824940e
It is still unconfirmed despite I locked it only until 389900
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4616



View Profile
December 24, 2015, 03:50:12 AM
 #5

Just curious... Why are you testing on mainnet instead of testnet?
sonicskye (OP)
Jr. Member
*
Offline Offline

Activity: 41
Merit: 2


View Profile WWW
December 24, 2015, 03:58:16 AM
 #6

Just curious... Why are you testing on mainnet instead of testnet?

I played with testnet before and it has the same problem of nodes not relaying nonstandard tx.
pianist
Legendary
*
Offline Offline

Activity: 954
Merit: 1003


View Profile
December 29, 2015, 11:02:53 PM
 #7

Just curious... Why are you testing on mainnet instead of testnet?

I played with testnet before and it has the same problem of nodes not relaying nonstandard tx.

And you pay real BTC for testing on mainnet? Smiley

You should check and test everything on testnet first!
sonicskye (OP)
Jr. Member
*
Offline Offline

Activity: 41
Merit: 2


View Profile WWW
December 30, 2015, 05:49:37 AM
 #8

Just curious... Why are you testing on mainnet instead of testnet?

I played with testnet before and it has the same problem of nodes not relaying nonstandard tx.

And you pay real BTC for testing on mainnet? Smiley

You should check and test everything on testnet first!


Yes I pay small amount of BTC in return of gained knowledge.
I found it harder to test on testnet anyway. or maybe I am just too lazy to retry....
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!