June 19, 2019, 05:57:20 am

Author Topic: GoldCoin Wallet v4.x  (Read 13177 times)

0 Members and 1 Guest are viewing this topic.

Offline Stouse49

  • Gold Engineer
  • DevTeam
  • *****
  • Posts: 711
  • Karma: +66/-0
    • View Profile
Re: GoldCoin Wallet v4.x
« Reply #15 on: June 27, 2016, 10:39:56 pm »
Here is  a picture of the app after receiving and sending coins.

GLD: E1A6WogjpqU3KjjoRUD63f7kofrFozmyfg

Offline Stouse49

  • Gold Engineer
  • DevTeam
  • *****
  • Posts: 711
  • Karma: +66/-0
    • View Profile
Re: GoldCoin Wallet v4.x
« Reply #16 on: June 28, 2016, 03:25:54 am »
Things are definitely progressing on the app.  Sending and Receiving work.

Some features do not work like Paper Wallet Sweep.  For this we need a block explorer that has an "Unspent" API similar to any ABE based block explorer as well as these:  cryptoID, Blockr and blockchain.info.  Someone can ask Dreamwatcher if his block explorer has that feature or if he can add it.

Once the previous item is addressed, we can update the goldcoin paper wallet (http://goldcoinwallet.com) to the latest version of bitaddress.org which supports BIP38 encrypted paper wallets and these can be imported by the GoldCoin App.  I have already modified the bitaddress.org paper wallet for GoldCoin and the GoldCoin app can read the private keys (with and without password encryption).

We need more working nodes that the app can connect to.  Currently it connects only to one and this prevents the app from being notified if a Transaction that it sent was received by the GoldCoin network.  The app sends out out a transaction to half of its connected nodes and waits for the other half to send it back to the app.  This is how the app verifies that a transaction that it sent was actually received by the network.

Code: [Select]
addnode=104.28.0.76
addnode=104.28.1.76
addnode=107.161.23.159
addnode=24.54.97.47
addnode=216.170.126.215
addnode=167.160.36.162 <-- app only connects to this one

Ideally, we should have a DNS seed node for the app to get nodes from.

Thanks for your support.  In a day or two I will publish the app to GitHub and put the link here. 

What remains is this:
pull some updates from Bitcoin Wallet that were recently published
Change all Bitcoin Text to GoldCoin.
Change all the icons from Bitcoin to Goldcoin.
Other fixes for not set seen bugs!
« Last Edit: June 28, 2016, 11:21:43 am by Stouse49 »
GLD: E1A6WogjpqU3KjjoRUD63f7kofrFozmyfg

Offline MicroGuy

  • @realMicroGuy
  • Administrator
  • *****
  • Posts: 3445
  • Karma: +47/-0
  • "Shoot for the Stars!"
    • View Profile
    • MicroGuy.com
Re: GoldCoin Wallet v4.x
« Reply #17 on: June 28, 2016, 03:43:59 pm »
Currently, there should be 3 dedicated DNS seed nodes active. One is operated by Dreamwatcher, one is hosted on my local network, and the third on a Linux VPS. I've sent a message to Akumaburn to ask if he can check the Linux VPS seed node. The local node I'm hosting is up and running. The node you have been connecting to is DreamWatcher's.



The .121 address is the Linux VPS maintained by Akuma, .162 is the DreamWatcher node, and the .47 is my locally hosted node.

In regards to the blockexplorer API, I will send a message to DreamWatcher today to see if he supports, or can add, the required feature.
"The heart of any cryptocurrency can be found in the spirit of its community."

Offline tadspoles

  • Legendary
  • *****
  • Posts: 629
  • Karma: +46/-0
    • View Profile
Re: GoldCoin Wallet v4.x
« Reply #18 on: June 28, 2016, 10:10:47 pm »
Stouse49 is the man!

Offline Stouse49

  • Gold Engineer
  • DevTeam
  • *****
  • Posts: 711
  • Karma: +66/-0
    • View Profile
Re: GoldCoin Wallet v4.x
« Reply #19 on: June 29, 2016, 11:20:10 pm »
The app still only connects to two nodes:  167.160.36.162 (the same is true for the old app).

24.54.97.47 is running with port 8121 open.

107.161.23.121 doesn't have port 8121 open (currently), so the app cannot connect.

The app has the limitation of not being able to request nodes from other nodes in the GoldCoin network.  Therefore, it only connects to a given node unless that address is a DNS seed that provides other actual nodes.  The standard bitcoin DNS Seeder is https://github.com/sipa/bitcoin-seeder.nslookup command will give a list of nodes from the Seed IP address and for these three IP addresses, for me nslookup returns only an error message.  However, if I do nslookup on a DNS seed for another coin:  dnsseed.darkcoin.io, then there are more than 10 IP addresses returned.
« Last Edit: June 30, 2016, 02:56:29 am by Stouse49 »
GLD: E1A6WogjpqU3KjjoRUD63f7kofrFozmyfg

Offline dreamwatcher

  • Gold Miner
  • ****
  • Posts: 138
  • Karma: +11/-0
    • View Profile
    • CryptoCoin Explorer
Re: GoldCoin Wallet v4.x
« Reply #20 on: June 30, 2016, 08:43:52 am »
I received Gregs E-mail and I am looking into adding an unspent function to the API on CCE.

The only major issue I can see (which is also an issue for ABE based explorers) is that it is a resource heavy database query.

An unspent function would work very much like a ledger request and would be written as a modified ledger function.

Right now the ledger request is the most resource intensive query (both API and WEB) as there is no way to efficiently calculate and store a ledger for every address.

Ledger requests are generated in real time and thus are limited to the last 100 credits/debits.

However, I am thinking that an unspent function could be lighter then a ledger request.



Exactly what information do you need from an unspent request? The ABE unspent function seems to send back some extraneous information. Would each unspent TX_IN hash and amount be all that you need?

Since this would be a resource heavy query, I would ask that you only use it when necessary and use other API functions when able. For example: Use the address balance function to get the total amount in an address. This is updated and stored every block update so it is a fast light query as it does not have to search the entire database/table(s) or preform multiple comparisons/calculations.

Offline MicroGuy

  • @realMicroGuy
  • Administrator
  • *****
  • Posts: 3445
  • Karma: +47/-0
  • "Shoot for the Stars!"
    • View Profile
    • MicroGuy.com
Re: GoldCoin Wallet v4.x
« Reply #21 on: June 30, 2016, 11:40:48 am »
107.161.23.121 doesn't have port 8121 open (currently), so the app cannot connect.

This morning, I was able to find someone to log onto this server and open port 8121.
"The heart of any cryptocurrency can be found in the spirit of its community."

Offline Stouse49

  • Gold Engineer
  • DevTeam
  • *****
  • Posts: 711
  • Karma: +66/-0
    • View Profile
Re: GoldCoin Wallet v4.x
« Reply #22 on: June 30, 2016, 11:47:42 pm »
107.161.23.121 doesn't have port 8121 open (currently), so the app cannot connect.

This morning, I was able to find someone to log onto this server and open port 8121.

Thanks MicroGuy, the app now connects to all three of those nodes.
GLD: E1A6WogjpqU3KjjoRUD63f7kofrFozmyfg

Offline Stouse49

  • Gold Engineer
  • DevTeam
  • *****
  • Posts: 711
  • Karma: +66/-0
    • View Profile
Re: GoldCoin Wallet v4.x
« Reply #23 on: July 01, 2016, 12:32:48 am »
I received Gregs E-mail and I am looking into adding an unspent function to the API on CCE.

The only major issue I can see (which is also an issue for ABE based explorers) is that it is a resource heavy database query.

An unspent function would work very much like a ledger request and would be written as a modified ledger function.

Right now the ledger request is the most resource intensive query (both API and WEB) as there is no way to efficiently calculate and store a ledger for every address.

Ledger requests are generated in real time and thus are limited to the last 100 credits/debits.

However, I am thinking that an unspent function could be lighter then a ledger request.



Exactly what information do you need from an unspent request? The ABE unspent function seems to send back some extraneous information. Would each unspent TX_IN hash and amount be all that you need?

Since this would be a resource heavy query, I would ask that you only use it when necessary and use other API functions when able. For example: Use the address balance function to get the total amount in an address. This is updated and stored every block update so it is a fast light query as it does not have to search the entire database/table(s) or preform multiple comparisons/calculations.

Dreamwatcher, hopefully I can answer your question in full.  This is an example of an unspent query from blockchain.info: https://blockchain.info/unspent?active=1GRrgAVXX9BabrWzqCUwpeXPWAYoxHUtbf which has the output: 
Code: [Select]

{
   
    "unspent_outputs":[
   
        {
            "tx_hash":"d308647962beb4bdef1647ce31e5305916cb20faec9729aa451094ec51c19b94",
            "tx_hash_big_endian":"949bc151ec941045aa2997ecfa20cb165930e531ce4716efbdb4be62796408d3",
            "tx_index":155886271,
            "tx_output_n": 1,
            "script":"76a914a93d562de5f42bd1eebc174845f6f16a24fef04b88ac",
            "value": 10000000,
            "value_hex": "00989680",
            "confirmations":1722
        }
     
    ]
}

The code in the Android Wallet is as follows:

Code: [Select]
final Sha256Hash uxtoHash = Sha256Hash.wrap(jsonOutput.getString("tx_hash"));
final int uxtoIndex = jsonOutput.getInt("tx_index");
final byte[] uxtoScriptBytes = Constants.HEX.decode(jsonOutput.getString("script"));
final Coin uxtoValue = Coin.valueOf(Long.parseLong(jsonOutput.getString("value")));

The above Java code simply means we need those four parameters from the unspent outputs:  tx_hash, tx_index, script and value (in satoshi).  One of your questions was "Would each unspent TX_IN hash and amount be all that you need?" - the answer is we also need the transaction index (tx_index) in addition to the TX_IN hash and the amount.  The script can be calculated from the address that is being queried.

How often would this be used?  Only as often as GoldCoin Android wallet users need to redeem or sweep a paper wallet.  They will use the app to scan the QR code of the private key of the Paper Wallet.  Then the app will generate the Address for the private key and query the block explorer using the unspent API.  Next, it will take the information and create a transaction with the inputs being the unspent outputs from the block explorer and the output will be an address in the Android Wallet App.  Lastly, the app will broadcast that transaction to the network and it will get verified and confirmed.  I don't think this will happen very often.

The app will not use any other function of your block explorer.  It is an SPV client and keeps track of its own balance, but it doesn't allow importing of other private keys because it doesn't keep the entire blockchain on the device.  The means by which the Bitcoin Wallet for android developers found to resolve this issue was to query an external service.

The unspent API may be as expensive as a ledger request.  It will need to look for all the incoming amounts (credits) and then all the outgoing amounts(debits) to determine which credits haven't been spent.

GLD: E1A6WogjpqU3KjjoRUD63f7kofrFozmyfg

Offline Stouse49

  • Gold Engineer
  • DevTeam
  • *****
  • Posts: 711
  • Karma: +66/-0
    • View Profile
Re: GoldCoin Wallet v4.x
« Reply #24 on: July 02, 2016, 05:18:31 am »
https://github.com/Stouse49/goldcoin-wallet/releases/tag/v4.58.0-beta

This is the first beta release.  The Word bitcoin hasn't been changed to GoldCoin in most places in the app (help text, etc).  The notification icon is still the Bitcoin icon.

Send and Receive work.

Paper Wallet Sweep doesn't work.

Let me know if there are any other problems.
GLD: E1A6WogjpqU3KjjoRUD63f7kofrFozmyfg

Offline MicroGuy

  • @realMicroGuy
  • Administrator
  • *****
  • Posts: 3445
  • Karma: +47/-0
  • "Shoot for the Stars!"
    • View Profile
    • MicroGuy.com
Re: GoldCoin Wallet v4.x
« Reply #25 on: July 02, 2016, 11:00:31 am »
This is excellent work.

I have downloaded the app and will begin testing send/receive today between app and desktop client.  :)


I'm using this QR scanner and my webcam to capture receiving addresses from the app: https://sourceforge.net/projects/zbar/ For me, the hardest part has always been getting coins from my desktop loaded onto the app.
« Last Edit: July 02, 2016, 11:17:58 am by MicroGuy »
"The heart of any cryptocurrency can be found in the spirit of its community."

Offline Stouse49

  • Gold Engineer
  • DevTeam
  • *****
  • Posts: 711
  • Karma: +66/-0
    • View Profile
Re: GoldCoin Wallet v4.x
« Reply #26 on: July 02, 2016, 04:24:13 pm »
This is excellent work.

I have downloaded the app and will begin testing send/receive today between app and desktop client.  :)


I'm using this QR scanner and my webcam to capture receiving addresses from the app: https://sourceforge.net/projects/zbar/ For me, the hardest part has always been getting coins from my desktop loaded onto the app.

I got a bug report from you which was an "Out of Memory" error when scanning a QR code in the app.  Not sure how to resolve it yet..
GLD: E1A6WogjpqU3KjjoRUD63f7kofrFozmyfg

Offline MicroGuy

  • @realMicroGuy
  • Administrator
  • *****
  • Posts: 3445
  • Karma: +47/-0
  • "Shoot for the Stars!"
    • View Profile
    • MicroGuy.com
Re: GoldCoin Wallet v4.x
« Reply #27 on: July 03, 2016, 10:50:21 am »
I'm not sure about the memory error. It only happened once and it was before the blockchain fully synced.

Question: would it be possible to add Niara NGN to the list of supported exchange rates?

"The heart of any cryptocurrency can be found in the spirit of its community."

Offline Stouse49

  • Gold Engineer
  • DevTeam
  • *****
  • Posts: 711
  • Karma: +66/-0
    • View Profile
Re: GoldCoin Wallet v4.x
« Reply #28 on: July 03, 2016, 07:01:22 pm »
I'm not sure about the memory error. It only happened once and it was before the blockchain fully synced.

Question: would it be possible to add Niara NGN to the list of supported exchange rates?


We need to find a website that has the currency on it.

Right now the app uses http://bitcoinaverage.com with http://blockchain.info as a backup for getting exchange rates.  I don't see that particular currency on either list.
GLD: E1A6WogjpqU3KjjoRUD63f7kofrFozmyfg

Offline MicroGuy

  • @realMicroGuy
  • Administrator
  • *****
  • Posts: 3445
  • Karma: +47/-0
  • "Shoot for the Stars!"
    • View Profile
    • MicroGuy.com
Re: GoldCoin Wallet v4.x
« Reply #29 on: July 03, 2016, 08:14:13 pm »
I'm not sure about the memory error. It only happened once and it was before the blockchain fully synced.

Question: would it be possible to add Niara NGN to the list of supported exchange rates?


We need to find a website that has the currency on it.

Right now the app uses http://bitcoinaverage.com with http://blockchain.info as a backup for getting exchange rates.  I don't see that particular currency on either list.

Thank you Eric for this reply.  :)

I was able to find a few API sources that might have the data you need.

(most popular)

The Coindesk Price Index has a public API that supports NGN:

http://www.coindesk.com/api/

(others)

Bitpay has NGN and appears to offer a free public API for exchange rates:

https://bitpay.com/bitcoin-exchange-rates
https://bitpay.com/api#resource-Rates

I've found this Nigerian bitcoin exchange with a public API:

https://www.bitx.co/in/ng/en/api
https://api.mybitx.com/api/1/tickers

(paid)

This is free up to 1,000 API requests/month but costs $12/month for 10,000 API requests:

https://docs.openexchangerates.org/docs/supported-currencies
https://oxr.readme.io/

I'll continue searching and will update the above list if I find more rate sources.
"The heart of any cryptocurrency can be found in the spirit of its community."