I'm building a script and have it's hex representation, then I convert it to a pubkey and address, which results in something like: 3NqNAUBEWarVjKerLcCnPrTGbaQ4QFcAfr or 2N7aFmKeUXbTSowccnkzJ44BZj8HFqLUUdm (when I set testnet parameters)
in elements when I try to build a transaction with createrawtransaction
to put some coin to that address I get:
Invalid prefix for Base58-encoded address
I've tried to build a descriptor with sh() and import it but that won't work because custom scripts are not supported.
Is it possible to use P2SH in elements? How do you generate the address from the script hex (it looks like it's different from bitcoin)?
PS: the script is built with python bitcoinlib like this
redeemScript = CScript([winner_key, OP_CHECKSIG, OP_IFDUP, OP_NOTIF, cashback_key, OP_CHECKSIGVERIFY, blocks_b, OP_CHECKSEQUENCEVERIFY, OP_ENDIF ])
where keys are hex representation of bytes, blocks_b is an int represented in bytes.hex(), I'm not really sure this is working, but I think there is something I'm missing on how to generate the address first.
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments