Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

M addresses don't work #5

Closed
karelbilek opened this issue May 11, 2017 · 8 comments
Closed

M addresses don't work #5

karelbilek opened this issue May 11, 2017 · 8 comments

Comments

@karelbilek
Copy link

For some reason, M-addresses don't work with insight, insight-api and litecore websocket API

example: this transaction is displayed with the M addresses

https://insight.litecore.io/tx/c9403d4bc1a09bb52cf8c5db5e0e3ecf38dfd22c83610fb1c6416d665a240040

but clicking on any of the addresses shows an error

https://insight.litecore.io/address/MUbHn23ZL733kCUbvQ88ZhVSWMdFQMEoV8

If I instead get the 3-address, it doesn't work either.

https://insight.litecore.io/address/3NP9U8dbNzBcwhChpX8nk4F3Bf2oSucXj1

This also applies to all the API calls (I think it is the same error). I can't find where it is at the bitcore stack right now exactly.

@karelbilek
Copy link
Author

A-ha, I got it. The error is actually from the c++ layer, not from the javascript layer.

It's because litecore is downloading this litecoin-litecore version

https://github.com/litecoin-project/litecore-litecoin/commits/v0.13.2.1-litecore-rc1

that's outdated and doesn't have the new address prefix.

@losh11
Copy link

losh11 commented May 11, 2017

Just ran litecoin-litecore 0.13.2.1 rc1 on my system, all multisig addresses seem to be working correctly.

createmultisig 2 '["LUww6kWcvyxpNhXMQuXw34Pu7RVYJ5jEfq","LZDaX6KgLtRaM7ZN29Di74iMTqrezj6NbZ","LXVL1huTGYgzUvumRxVpbiWVwT9Nj7vhvk"]'

{
  "address": "MVCNRYZhAY9FAR2UkcnJkn1jvanTP1QES1",
  "redeemScript": "522103ac93aef434de5b030eafdb030e4db43ba563c1414f21495834fece5ff03394c1210383f7fdb75a64d511451d542eb3924dc0d48f6e58fc8142eefbe7d9e5ac915eaa21029f078983a908cd962a9d0f206f931561c7e57d1939c9eb9eb1034053e2987c7c53ae"
}

Are you sure that's the issue?

@karelbilek
Copy link
Author

karelbilek commented May 11, 2017 via email

@losh11
Copy link

losh11 commented May 12, 2017

I think it's something to do with insight-api or litecore-lib...

http://insight.litecore.io/api/addr/3NP9U8dbNzBcwhChpX8nk4F3Bf2oSucXj1
API returns Invalid address: Address has mismatched network type.. Code:1

@karelbilek
Copy link
Author

karelbilek commented May 15, 2017

Nope, it's indeed an issue with the litecore-litecoin fork.

./litecoin-cli getaddresstxids '{"addresses":["MUbHn23ZL733kCUbvQ88ZhVSWMdFQMEoV8"]}'

error code: -5
error message:
Invalid address

It's probably something with the fact that you have two different P2SH prefixes now and the address index doesn't count with that. Please fix that in the address index patch

@karelbilek
Copy link
Author

IMHO it should be enough to add SCRIPT_ADDRESS2 whenever there is SCRIPT_ADDRESS here

https://github.com/litecoin-project/litecore-litecoin/blob/f3b80661ae103a0382ce36de7cc0752c8b83d420/src/base58.cpp

@losh11
Copy link

losh11 commented May 15, 2017

That's the dev branch (old version), the latest release of litecore-litecoin is from the 0.13-master branch, which hasn't been switched to default yet.

@karelbilek
Copy link
Author

karelbilek commented May 15, 2017

There was one place that didn't have the second SCRIPT_ADDRESS which caused the error.

I have fixed the issue and made a PR; I can confirm insight/bitcore works now, including all the websocket APIs (that we need for trezor web wallet :))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants