Not able to generate correct P2SH-P2WSH address from given redeem script

can you please provide me the generation code, i am struggling to generate a p2sh-p2wsh address from the given redeem script, actually there is no witness program key given , so is it even possible for me to generate the address which is 32...... in this case, i just wanted to recheck whether my generated address and the given address comes out to be same

Transaction Spec
Private Key 1: 39dc0a9f0b185a2ee56349691f34716e6e0cda06a7f9707742ac113c4e2317bf
Private Key 2: 5077ccd9c558b7d04a81920d38aa11b4a9f9de3b23fab45c3ef28039920fdd6d
Redeem Script (ASM): OP_2 032ff8c5df0bc00fe1ac2319c3b8070d6d1e04cfbf4fedda499ae7b775185ad53b 039bbc8d24f89e5bc44c5b0d1980d6658316a6b2440023117c3c03a4975b04dd56 OP_2 OP_CHECKMULTISIG
Redeem Script (HEX): 5221032ff8c5df0bc00fe1ac2319c3b8070d6d1e04cfbf4fedda499ae7b775185ad53b21039bbc8d24f89e5bc44c5b0d1980d6658316a6b2440023117c3c03a4975b04dd5652ae
Transaction should contain exactly 1 input with:
Outpoint:
Hash: 0000000000000000000000000000000000000000000000000000000000000000
Index: 0
Sequence: 0xffffffff
Transaction should contain exactly 1 output with:
Value: 0.001
Address: 325UUecEQuyrTd28Xs2hvAxdAjHM7XzqVF
Locktime: 0

i have been doing this in python

# Given Redeem Script (HEX)
redeem_script_hex = "5221032ff8c5df0bc00fe1ac2319c3b8070d6d1e04cfbf4fedda499ae7b775185ad53b21039bbc8d24f89e5bc44c5b0d1980d6658316a6b2440023117c3c03a4975b04dd5652ae"
script_bytes = bytes.fromhex(redeem_script_hex)
sha256_hash = hashlib.sha256(script_bytes).digest()
redeem_script_hash = hashlib.new("ripemd160", sha256_hash).digest()
prefixed_hash = b'\x05' + redeem_script_hash
checksum = hashlib.sha256(hashlib.sha256(prefixed_hash).digest()).digest()[:4]
final_data = prefixed_hash + checksum
address = base58.b58encode(final_data).decode()
print(address)

to which the putput comews to be

h-multisig-tx-jatin-2708/python$ python main.py
39C5GaHDocqYVgyCq2TrMfknTL45LPPcKF

but it should come

Address: 325UUecEQuyrTd28Xs2hvAxdAjHM7XzqVF (as given in ques)

seems like the witness is missing thats why addresses are coming different , can anyone explain...?



from Recent Questions - Bitcoin Stack Exchange https://ift.tt/MyXi9r6
via IFTTT

Popular posts from this blog

Bitcoin Mining Could Be Strengthening The Ruble, Russian Central Bank Says

Crypto Exec Warns Tokenization Is Moving Faster Than Expected

Bitwise Clients Pour $69M Into Solana as Bulls Fight to Reclaim $200 Resistance Zone