<p>I am trying to create a htlc smart contract manually by writing a script and finding the hex using the btcc compiler. Now node A has to create a transaction using that hex and lock money in that p2sh address for upto 150 blocks. If node B can provide the secret value before 150 blocks then he can claim the coins and if not the it will go back to node A. I am new to this concept and where ever i read about creating transactions they are explaining in a theoretical way and I could not understand what to do the redeem script hex and how to lock money and how will node B claim it before 150 blocks and how will the raw transaction created by node A will be accessible to node B. Can you please give a reference or steps to follow to understand and implement it? I want to start from the basic with step by step guide.</p>

<p>Which documentation should i refer for doing it and what commands should be used and how it should be used?</p>

<p>How to create the p2sh address. And another problem i am facing is that i am getting different hash160 everytime in different website. Not sure which one is accurate. Please guide me.</p>

<p>P.S: I am running bitcoin in regtest mode.
Collapse</p>

CC BY-SA 4.0
2019-07-08T13:59:46.880Z
Can you share the script you are writing and what you've tried so far?
JBaczuk
CC BY-SA 4.0
2019-07-09T05:46:43.573Z
https://bitcoin.stackexchange.com/questions/74753/htlc-hash-time-lock-contract-using-bitcoin-qt
annant vijay
CC BY-SA 4.0
2019-07-09T05:46:59.700Z
I am trying this.
annant vijay
<bitcoind><hash><p2sh><hash-time-locked-contract>
Method to create P2SH address
annant vijay
# Method to create P2SH address

(Asked by: username_0 on 2019-07-08)

I am trying to create a htlc smart contract manually by writing a script and finding the hex using the btcc compiler. Now node A has to create a transaction using that hex and lock money in that p2sh address for upto 150 blocks. If node B can provide the secret value before 150 blocks then he can claim the coins and if not the it will go back to node A. I am new to this concept and where ever i read about creating transactions they are explaining in a theoretical way and I could not understand what to do the redeem script hex and how to lock money and how will node B claim it before 150 blocks and how will the raw transaction created by node A will be accessible to node B. Can you please give a reference or steps to follow to understand and implement it? I want to start from the basic with step by step guide.

Which documentation should i refer for doing it and what commands should be used and how it should be used?

How to create the p2sh address. And another problem i am facing is that i am getting different hash160 everytime in different website. Not sure which one is accurate. Please guide me.

P.S: I am running bitcoin in regtest mode.
Collapse

**Tags:** bitcoind, hash, p2sh, hash-time-locked-contract

> **Comments:**
> **username_1**: Can you share the script you are writing and what you've tried so far?  
> **username_0**: https://bitcoin.stackexchange.com/questions/74753/htlc-hash-time-lock-contract-using-bitcoin-qt  
> **username_0**: I am trying this.  

---

## 0 answers

