Bible Pay

Read 151 times

  • MIP
  • Jr. Member

    • 82


    • 7
    • February 13, 2018, 11:55:52 am
    more
Iquidus Explorer: upgrade to support GETUTXO in API
« on: April 11, 2018, 02:04:23 pm »
We need Iquidus explorer to support GETUTXO in its API.

It's required to support the paper wallet sweep in mobile versions. I expected Breadwallet to support this via some SPV functionality but it was not the case.

SCOPE OF WORK

- Starting from current Iquidus Explorer master version, implement GETUTXO in explorer API

http://explorer.biblepay-central.org/ext/getutxos/{address}

Output format will be recognized by Biblepay mobile wallet.
(see sample in https://api.breadwallet.com/q/addr/3PauLgPVQu2r6QnvWvK1GDGXdeB3ouCdqw/utxo?currency=BTC)


TASK BREAKDOWN

- Fork Iquidus explorer project, install biblepaycore, install explorer on a dev ubuntu computer (2h)
- Change database load to store outpoint hash and index in transaction inputs (2h)
- Implement check_is_unspent as a query to know if an output has already been used (1h)
- Implement API route /ext/getutxos (2h)
- Explorer full load tests (2h)

Total Budget:
9h dev&test @40/h = 360
= 0,064285 BTC (@ 5600) = 173745 BBP (@37 sat)

Work is very advanced, and it works pretty fast. It will be a nice addition that few coin explorers have.

All code will be open sourced.

I will need Lichtsucher's help to update biblepay-central explorer. I don't know if you have a test environment before we go live.
A full reindex of the database will be required so expect a few hours downtime.
« Last Edit: April 13, 2018, 02:16:57 am by MIP »


  • jaapgvk
  • Sr. Member

    • 409


    • 15
    • September 01, 2017, 08:02:57 pm
    • Netherlands
    more
Re: Iquidus Explorer: upgrade to support GETUTXO in API
« Reply #1 on: April 11, 2018, 04:51:23 pm »
You da man MIP 8)


  • MIP
  • Jr. Member

    • 82


    • 7
    • February 13, 2018, 11:55:52 am
    more
Re: Iquidus Explorer: upgrade to support GETUTXO in API
« Reply #2 on: April 12, 2018, 10:07:59 am »
Ok I tried to add outpoint info in inputs so with a simple query you could know if it's unspent or not.

However, there was a trap:  Iquidus explorer iterates through all transaction inputs, but doesn't record all of them, it creates only one per address and then accumulates the amounts over the same "virtual" input.  This is logical as it is what we expect to see in the user interface.

So my initial approach can't work.

My "plan B" approach is, when processing inputs, trying to recover back the original output  and "mark" it as spent, then save again.  It way harder to implement, but probably the only way to go without changing the database model drastically.

 


  • MIP
  • Jr. Member

    • 82


    • 7
    • February 13, 2018, 11:55:52 am
    more
Re: Iquidus Explorer: upgrade to support GETUTXO in API
« Reply #3 on: April 12, 2018, 01:19:33 pm »
Plan B seemed to work. It's about maintaining a clear list of the address UTXOs.

It takes a bit more database space and longer to index (about twice the time) but the good point is that calling the getutxo API is 5 times faster than the other way. I don't expect the other queries to be affected.

As soon as I can contact Lichtsucher we will try to test it on a test environment.




  • MIP
  • Jr. Member

    • 82


    • 7
    • February 13, 2018, 11:55:52 am
    more
Re: Iquidus Explorer: upgrade to support GETUTXO in API
« Reply #4 on: April 13, 2018, 02:17:04 am »
Proposal created. Kindly consider to vote for this proposal, included in this month IT budget, if you find it interesting:

gobject vote-many 03aa25b80bf951bcaaed1589a52c8cd8cf58893912df176c2b4bafef47d90296 funding yes

Thenk you


  • znffal
  • Full Member

    • 114


    • 3
    • October 02, 2017, 04:01:47 pm
    more
Re: Iquidus Explorer: upgrade to support GETUTXO in API
« Reply #5 on: April 13, 2018, 04:54:05 am »
Proposal created. Kindly consider to vote for this proposal, included in this month IT budget, if you find it interesting:

gobject vote-many 03aa25b80bf951bcaaed1589a52c8cd8cf58893912df176c2b4bafef47d90296 funding yes

Thenk you

Hi MIP,

I just wanted to say that you are doing a fantastic job. I will be voting for your proposals.
Also, I am not sure if others are like me, but I usually wait intil the last week before the superblock to vote, just so that I get a good idea of what is in the budget.

Thanks!


  • MIP
  • Jr. Member

    • 82


    • 7
    • February 13, 2018, 11:55:52 am
    more
Re: Iquidus Explorer: upgrade to support GETUTXO in API
« Reply #6 on: April 13, 2018, 05:50:46 am »
Hi MIP,

I just wanted to say that you are doing a fantastic job. I will be voting for your proposals.
Also, I am not sure if others are like me, but I usually wait intil the last week before the superblock to vote, just so that I get a good idea of what is in the budget.

Thanks!

I agree, voting the last week should be the right approach, as several proposals could be competing for the same resources, and votes should work as a way to prioritize the most critical projects.

In this particular month, I think the only IT proposals are mine but there could be a month where this is not the case.


  • Rob A.
  • Administrator

    • 1022


    • 15
    • June 05, 2017, 08:09:04 pm
    • Patmos, Island Of
    more
Re: Iquidus Explorer: upgrade to support GETUTXO in API
« Reply #7 on: April 14, 2018, 10:58:51 am »
Great job!  Im glad you got the API path to expose the UTXOs, and figured out a way to persist the UTXO value in the database!

Im sure Lich will be happy to resync his chain!

Awesome!



  • MIP
  • Jr. Member

    • 82


    • 7
    • February 13, 2018, 11:55:52 am
    more
Re: Iquidus Explorer: upgrade to support GETUTXO in API
« Reply #8 on: April 14, 2018, 02:42:52 pm »
Great job!  Im glad you got the API path to expose the UTXOs, and figured out a way to persist the UTXO value in the database!

Im sure Lich will be happy to resync his chain!

Awesome!

It's better to give it a good try first on a test environment, I want to be sure that this add-on is not impacting on the performance (it should not). However it will eat some storage, for example addresses collection takes about 180MB now and processing time for each transaction is slower than before.

I also found some glitches in PoDC staking addresses, as some UTXOs are not properly removed from the database array.
But we are quite close.
« Last Edit: April 14, 2018, 02:46:19 pm by MIP »


  • MIP
  • Jr. Member

    • 82


    • 7
    • February 13, 2018, 11:55:52 am
    more
Re: Iquidus Explorer: upgrade to support GETUTXO in API
« Reply #9 on: April 17, 2018, 05:45:11 am »
Ok, I think I finished polishing, development is finished.

I sent the update to Lichtsucher so he can do a final test of the last version on his environment.

As soon as this is published in biblepay-central explorer, I will release the Android mobile app in Google Play.


  • jaapgvk
  • Sr. Member

    • 409


    • 15
    • September 01, 2017, 08:02:57 pm
    • Netherlands
    more
Re: Iquidus Explorer: upgrade to support GETUTXO in API
« Reply #10 on: April 17, 2018, 06:00:47 am »
Ok, I think I finished polishing, development is finished.

I sent the update to Lichtsucher so he can do a final test of the last version on his environment.

As soon as this is published in biblepay-central explorer, I will release the Android mobile app in Google Play.

AWESOME!  8)