Author

Topic: How to create P2SH Redeem script in python (Read 75 times)

newbie
Activity: 8
Merit: 0
November 05, 2024, 08:33:13 AM
#5

You don't have to delete the thread
At the left bottom corner of the thread
There's a move topic option there, you can click that and select the development and technical board.

But what do you want?
The python code in running it?
What the script mean or how's it'd been run?

What they mean can be gotten here https://en.bitcoin.it/wiki/Script

And for running the script
https://ide.scriptwiz.app/

Thanks, in case next time I want to move my topic, I appreciate.

What I need help with is just like the way I can code a tx in python example

Code:
from Bitcoin import *

private_key = " "
tx_input = " "
address= " "
Amount = " "
Fee = " "

Tx =
Tx_id =
print(f"TX ID: {Tx_id}")

Get the transaction id and send to a miner, how can I do this for P2SH scripts so to spend/move the content to another address ?
sr. member
Activity: 490
Merit: 397
Playbet.io - Crypto Casino and Sportsbook
November 05, 2024, 07:58:51 AM
#4
Firstly Op this your post is actually one that should be in the bitcoin technical discussion board and not the regular bitcoin discussion board. Secondly Op, in my opinion your post is quite vague. That's because, firstly the code or programming script that you have here in your post which I think is actually supposed to act like an example illustrating your point is not even a phyton script and the syntax too isn't.  From my experience so far, the example you've have here in your post is a bitcoin script and not a phyton script.

Also I'm not sure if anyone can help you out properly with only the information you have given so far. Personally I still don't get what exactly you are looking for. Are you actually looking to create a. Phyton script that will run with an output similar to the bitcoin script.

I wanted to delete the post and post in Bitcoin technical discussion board but I can't delete my own thread.

The codes are just OPCODES used in creating the P2SH script and not written in python programming language

Can a moderator help delete or cross-post to Bitcoin technical discussion ?
You don't have to delete the thread
At the left bottom corner of the thread
There's a move topic option there, you can click that and select the development and technical board.

But what do you want?
The python code in running it?
What the script mean or how's it'd been run?

What they mean can be gotten here https://en.bitcoin.it/wiki/Script

And for running the script
https://ide.scriptwiz.app/
newbie
Activity: 8
Merit: 0
November 05, 2024, 06:16:39 AM
#3
Firstly Op this your post is actually one that should be in the bitcoin technical discussion board and not the regular bitcoin discussion board. Secondly Op, in my opinion your post is quite vague. That's because, firstly the code or programming script that you have here in your post which I think is actually supposed to act like an example illustrating your point is not even a phyton script and the syntax too isn't.  From my experience so far, the example you've have here in your post is a bitcoin script and not a phyton script.

Also I'm not sure if anyone can help you out properly with only the information you have given so far. Personally I still don't get what exactly you are looking for. Are you actually looking to create a. Phyton script that will run with an output similar to the bitcoin script.

The codes are just OPCODES used in creating the P2SH script and not written in python programming language
sr. member
Activity: 448
Merit: 560
Crypto Casino and Sportsbook
November 05, 2024, 06:09:04 AM
#2
Firstly Op this your post is actually one that should be in the bitcoin technical discussion board and not the regular bitcoin discussion board. Secondly Op, in my opinion your post is quite vague. That's because, firstly the code or programming script that you have here in your post which I think is actually supposed to act like an example illustrating your point is not even a phyton script and the syntax too isn't.  From my experience so far, the example you've have here in your post is a bitcoin script and not a phyton script.

Also I'm not sure if anyone can help you out properly with only the information you have given so far. Personally I still don't get what exactly you are looking for. Are you actually looking to create a. Phyton script that will run with an output similar to the bitcoin script.
newbie
Activity: 8
Merit: 0
November 05, 2024, 05:52:15 AM
#1
I just came across a medium post about non standard p2sh scripts and the writer gave examples, I took this script as an example
"OP_2DUP  OP_ADD  OP_8  OP_EQUALVERIFY  OP_SUB  OP_2  OP_EQUAL"
It has been spent, the solution is x + y - 8 = x - y = 0...... x = 5, y = 3.

So if I came across this earlier how do I code the redeem transaction in python ?
Jump to: