Replies: 3 comments 4 replies
-
This address is not a witness address, so PayToWitnessPubkeyHash will not work with it. Use segwit address, starting with "ltc...". |
Beta Was this translation helpful? Give feedback.
-
could it be p2sh addresses in litecoin are not correctly handled? Line 44 in 76c53ec 0x50 but litecoin p2sh addresses now begins with 0x32 : https://bitcoin.stackexchange.com/a/80355/85343
|
Beta Was this translation helpful? Give feedback.
-
I have tried another approach following the script injection in the test: wallet-core/swift/Tests/Blockchains/BItcoinTests.swift Lines 112 to 114 in 9c5927e but got error:"Missing redeem script." trying to sign.
I tried the following: for i, _ := signingInput.Utxo {
...
p2shScript := C.TWBitcoinScriptLockScriptForAddress("MTt3sGWkFQQVhFh11Jk6bxSWv5C6VamAdu", uint32(2))
p2shScriptData := C.TWBitcoinScriptData(p2shScript)
pubkeyHash := C.TWHashSHA256RIPEMD(C.TWPublicKeyData(pub))
p2wpkhScript := C.TWBitcoinScriptBuildPayToWitnessPubkeyHash(pubkeyHash)
p2wpkhScriptData := C.TWBitcoinScriptData(p2wpkhScript)
signingInput.Scripts[hex.EncodeToString(TWDataGoBytes(p2shScriptData))] = p2wpkhScriptData
signingInput.Utxo[i].Script = p2shScriptData
} If I use |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I took reference from the example here
wallet-core/swift/Tests/Blockchains/BItcoinTests.swift
Line 84 in 9c5927e
except that I tried doing the steps with litecoin and input address such as
MTt3sGWkFQQVhFh11Jk6bxSWv5C6VamAdu
, but generating the script withand
AnySigner.Sign
would returnerror:"Invalid output script"
;while trying with
it signs and decodes the transaction without problem, but when trying to broadcast the raw tx in hex on blockchair.com, I got
bad-txns-nonstandard-inputs (code 64)
I have also tried another approach following the spec: https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki
but then I got
error:"Missing redeem script
I am using go and I hope the above example provides a clear illustration. Could you advise which part have I got wrong or is nested segwit for litecoin supported in wallet-core?
Beta Was this translation helpful? Give feedback.
All reactions