Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNSPENT api #37

Open
dobbscoin opened this issue Apr 16, 2016 · 18 comments
Open

UNSPENT api #37

dobbscoin opened this issue Apr 16, 2016 · 18 comments

Comments

@dobbscoin
Copy link

@dobbscoin dobbscoin commented Apr 16, 2016

UNSPENT API: Is there such a thing?

My schildbach wallet developer says he needs to be able to querry unspent outputs.. 'er something, and seems to be suggesting that the explorer might have it. I know the wallet can listunspent from addresses it owns, but it's not something the Iquidus Explorer can currently do. -right?

@dobbscoin

This comment has been minimized.

Copy link
Author

@dobbscoin dobbscoin commented Apr 30, 2016

Will 2.0 Iquidus Explorer be able to list UNSPENT from all addresses?
My androidDev complains about not being able to SWEEP paper wallets.

@mmitech

This comment has been minimized.

Copy link

@mmitech mmitech commented May 1, 2016

fork insight for your coin, it has an advanced RESTful API and utxo is included

@iquidus

This comment has been minimized.

Copy link
Owner

@iquidus iquidus commented May 1, 2016

http://bitcoin.stackexchange.com/questions/4301/what-is-an-unspent-output/4302#4302

Unless you're coin is doing anything odd, this should be the same as total supply. you can get this via the api easily with.

http://example.com/ext/getmoneysupply

insight is ok, however user requests are very slow, this is why i have the server doing all of the heavy lifting with the indexing process, so user requests are simply database queries, much faster page loads for the user.

@dobbscoin

This comment has been minimized.

Copy link
Author

@dobbscoin dobbscoin commented May 2, 2016

I Think the developers issue has something to do with how the schildbach android wallet imports balances/sweeps coins from privatekey/paperwallets. He's having exams this week. Thanks for the reply's, I'll see if I cant get him to join in the thread to explain himself a little broader.

@iquidus

This comment has been minimized.

Copy link
Owner

@iquidus iquidus commented May 2, 2016

ah I see. I will look into the android wallet.

@Infernoman

This comment has been minimized.

Copy link

@Infernoman Infernoman commented Jul 17, 2016

heres an example from insight-api which is... pretty much unusable.
http://transfer.infernopool.com/api/addr/TjGbGkh18vLqSKPCTqDjqYUbMCwzcdtEEG/utxo?noCache=1

a much better method for this is needed than what's currently available. I would be able to put a bounty toward this item.

getrawtransaction
decoderawtransaction

then add elements into the database so it's not as inefficient Below is an example [{"address":"TjGbGkh18vLqSKPCTqDjqYUbMCwzcdtEEG","txid":"5bc575a29c717c7f7412edc5b240632cd9f7bee384c17b3aeaaae88bddb1ea04","vout":1,"ts":1468733104,"scriptPubKey":"76a9146d45d01257be9d2cdca9f4bf5d4e7ead687eb43e88ac","amount":32.80596375,"confirmations":148,"confirmationsFromCache":false}]

@vroomDotClub

This comment has been minimized.

Copy link

@vroomDotClub vroomDotClub commented Apr 30, 2017

Anything being done with this?

@olegmitrakhovich

This comment has been minimized.

Copy link

@olegmitrakhovich olegmitrakhovich commented Aug 26, 2019

would be great to have this call.

@zilveer

This comment has been minimized.

Copy link

@zilveer zilveer commented Jan 22, 2020

Any progress of listing unspent in the API?

@uaktags

This comment has been minimized.

Copy link
Collaborator

@uaktags uaktags commented Jan 23, 2020

Unfortunately I don't believe anything had come of it. I've also not seen any PRs or forks that include it.

@TheHolyRoger

This comment has been minimized.

Copy link
Collaborator

@TheHolyRoger TheHolyRoger commented Jan 23, 2020

Implementing this API requires a complete overhaul of Iquidus indexing.

For reference, insights utxo function:
https://gist.github.com/jackzampolin/da3201b89d23dd5fa3becb0185da1fb2#utxo-details

Iquidus currently groups transaction vins/vouts together for address1 <-> address 2.

We'd need to change this to index ALL vins/vouts like insight, then add functionality to mark old transactions VOUTs as SPENT as new TXs come in that use them as VINs.

I'm not opposed to this, as it might fix another issue we had with parallelising TX indexing.

It would probably add some overhead though, to the front end at least as it's less 'clean'.

@olegmitrakhovich

This comment has been minimized.

Copy link

@olegmitrakhovich olegmitrakhovich commented Jan 23, 2020

I did find this... https://github.com/MIPPL/iquidus-getutxos-explorer ... I tried it, it works ok... however, when I started to do load testing on my chain and pushing 1,000s of transactions ... I noticed that this version of iquidus was not keeping up. I later find out, that it is not a good idea to use MongoDB because of the 16mb .bson limitation ... So I think this version of Iquidus will work fine if your chain doesn't have too much traffic.

@TheHolyRoger

This comment has been minimized.

Copy link
Collaborator

@TheHolyRoger TheHolyRoger commented Jan 24, 2020

I was actually wondering if it might be an idea to switch to SQL for the performance of historical address balance calculation.

Big change though....

@uaktags

This comment has been minimized.

Copy link
Collaborator

@uaktags uaktags commented Jan 24, 2020

But MySQL in NodeJS is terrible

@olegmitrakhovich

This comment has been minimized.

Copy link

@olegmitrakhovich olegmitrakhovich commented Jan 24, 2020

Yeah lol, I tried making one using mysql and node.js using this tutorial:
https://www.education-ecosystem.com/tvle83/2PY30-how-to-create-a-blockchain-explorer-with-javascript/5pbJX-how-to-create-a-blockchain-explorer-with-javascr-5/

it didn't work out that great ahah. I also found articles of people explaining why it's not a good idea to use SQL, like this one:
https://www.quora.com/How-is-Bitcoin-Block-Explorer-Blockchain-info-architected

I really liked Iquidus but I am using Trezor's blockbook at this point, it uses RocksDB ... so maybe if Iquidus changes to RocksDB people would jumping all over it, since Iquidus is much easier to setup than Blockbook.

@uaktags

This comment has been minimized.

Copy link
Collaborator

@uaktags uaktags commented Jan 24, 2020

I've never really looked into Blockbook being that it's written in go. But in the conversation of RocksDB, I'm not sure the reasoning for using that over Redis (maybe Rocks is more supported in Go than Redis?) unless it's just the fact that RocksDB uses flash storage as well as RAM.

I'd love to use MySQL if coding for it in NodeJS wasn't a test against ones own sanity. I do like the idea of historical data though going to something other than mongo. I think we'll just need to keep in mind the idea that schema's can change, which is the nicety of mongo and other nosql

@TheHolyRoger

This comment has been minimized.

Copy link
Collaborator

@TheHolyRoger TheHolyRoger commented Jan 24, 2020

@uaktags are you suggesting a combination of redis + mongo?

The alternative is leveldb like insight I suppose.

Maybe the PR you found is the way to go, that way we're not indexing all vins and vouts which would massively impact the database size

@uaktags

This comment has been minimized.

Copy link
Collaborator

@uaktags uaktags commented Jan 25, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.