@Goals:#18 - android wallet

I want to clarify one part of point 18 of Goals thread http://www.peercointalk.org/index.php?topic=1093.0

Bitcoin wallets for Android are based on BitcoinJ library. There is no simple way to port this library to Peercoin.
BitcoinJ is using Simplified Payment Verification(SPV https://en.bitcoin.it/wiki/Scalability#Simplified_payment_verification), in two words: thin node needs only block headers and merkle tree branch to verify transaction. With Peercoin, for each PoS block, it would also need coinstake, hash of block with coinstake, transactions(with merkle branch) for each coinstake input. It is doable but practically it won’t be SPV anymore.
What we can do with BitcoinJ is to make full Peercoin Java(Android compatible I hope) client. Steps:

  1. Modify network parameters(done)
  2. Implement coinstake verification
  3. Modify H2FullPrunedBlockStore
  4. Implement coinstake generation
    If there would be enough interest, and at least one more Java coder here, we could try to port it.

Porting to Primecoin should be much easier(POW verification partially done)

BitcoinJ, btw great library, without almost any modifications can be used in Peercoin projects to:

  • manage keys
  • receive blocks/transactions from network
  • create and broadcast transactions(also with advanced scripting)
    By joining it with RPC client it can be solid base for advanced projects. If anyone is interested in using it that way- please post here or PM.

Cheers!

playing round with the different coin clients on android…

Yes bitcoin is based off the headers only so doesn’t take the whole BC down… but feathercoin and litecoin seem to behave differently… are they fundamentally different code behind in how they work? if so it would be nice to offer both for peercoin as I would actualy have a need / desire for both.

I would like to be involved in this project… i have all the tools to build an android app… just never done it.

Fuzzybear

Hi FuzzyBear!
Glad to hear that you’re interested
BTC, LTC, FTC and XPM are pure PoW so need only headers to decide which chain is valid(most Work put in it).
With PoS, to choose valid chain, you need chain of:

  • block header
  • coinstake + merkle branch(proof that coinstake tx was in that block)
  • coinstake input transactions + their merkle branches(proof that used stake was previously in that chain)
    It’s no longer “Simplified” so road to nowhere.

With SPV for XPM there are two major issues:

  • primecoind doesn’t support getheaders message (we can ask devs to implement it/make it ourselves)
  • Primecoin has variable block header size(BTC has fixed 80 bytes) so changes in BitcoinJ won’t be so trivial
  • I don’t know if bloom filters are implemented in primecoind

Now some Pros :slight_smile: :

  • we can port BitcoinJ w/o actually touching Android at all, we can write/test on desktops with only JRE installed
  • once BitcoinJ is ported - we’ll have MultiBit for XPM ready!

Personally, as I’m mostly invested in PPC(quite big - currently), I’d prefer full PPC Java/Android client development.
But if XPM really needs thin client and getheaders will be implemented - it will be fun to work on it!

Awesome! :slight_smile:
I have been expecting the android client for a long time. The current 260MB blockchain + PoS mining could make PPC the most decentralized network and therefore the most secure one (plus cold-locked feature).
There are so much potential in PPC.
I am not a coder. What I could do is to donate some coins and to relay the progress to Chinese PPCers.
Merry Christmas and have a wonderful time!

我和楼上一样很期待PPC的Android的手机客户端。
我想说一下,我对钱包的看法。
手机钱包会和电脑钱包一样会给用户每一年百分之一的利息而且每30天结算一次吗?(也就是说手机客户端能够进行POS挖矿吗?)
我希望手机客户端不要像电脑客户端一样,同步大量的数据。
我心中理想的手机客户端是:
不一定可以进行pos挖矿。
手机客户端我认为可有可无,但是为了面子还是需要一个的。但是不能够粗燥,要和比特币钱包一样方便。说到点点币转账需要巨额的手续费,没有人会频繁的交易。
我建议PPC团队开设一个Ripple网关,将来ripple手机客户端发布了,大家转账就方便了。
我真心的希望PPC在4.0发布以后,它的手续费能够降一降。0.01太贵了。真心的贵。
楼上minner麻烦您帮我翻译一下。我也学过一点英文一年。不过没有坚持哎。该死的家人只看到眼前的那些个废纸人民币。

http://ppc.cryptocoinexplorer.com/chain/PPCoin?count=161&hi=87668
这个是12月25日24小时之内PPC区块链的所有区块,应该是159块。其中PoS块有133块,占84%。余下的是PoW块。

PPC 目前运行了大概500天左右。整个区块链在230MB左右。这必须归功于0.01手续费,使得PPC用户会认真谨慎地执行任何一笔交易。尘量交易基本被杜绝了,使得PPC的完整区块链在体积上比BTC的13G,LTC的约2.3G要轻便很多。

查看PPC的区块大小:http://bitinfocharts.com/comparison/size-ppc.html
可以看到大部分区块的体积都保持在300kb以下。
我个人的观点:

  1. 维持0.01的交易费不变。不要轻易改变,假如PPC达到100刀,每交易1个PPC也仅支付1美元的交易费,这对银行的1%+的手续费来讲也是有优势的。
  2. 假设PPC的区块链仍能维持目前的大小,区块链每年只需增长180MB。
  3. PPC的定位是“价值储存单位” 或者是SK 所说的“骨干”货币,而不是用于日常支付的手段。如果你想要日常支付,大可使用BTC或者LTC。
  4. 轻量的完整区块链,使得手机客户端也可以下载完整的区块链。(这一点非常重要,BTC/LTC都已经失去了这种可能性,他们的手机客户端是下载区块链的头部数据即SPV数据,而不是完整的区块链。)前几天已经有人开帖,准备开发PPC的安卓客户端了。

另外,PPC手机客户端能够下载完整区块链是优势,而非劣势。而且能够进行PoS挖矿也是非常重要的。

I have never coded anything for mobile apps, but I thought I might throw some ideas around. Since some people leave their clients on for PoS minting, can we maybe just have an app that will access your home wallet, instead of writing a new wallet for the android?

Just noticed that NXT got an Android wallet.

I thought NXT is proof-of-stake only, so is it something we can re-use? I’m not a coder, so please tell me if this is not so useful.

It comes with the source code.
https://nextcoin.org/index.php/topic,797.0.html

Just bumping this because I think it’s great there is interest in developing a mobile PPC wallet. I know I’d be willing to pay a couple bucks in a heartbeat for it.

Once our system is released it will fully be supported on iPhone, Android, Windows Phone and Blackberry.

Users will be able to login and have access to their wallets / send / receive commands, and much more :slight_smile:

We look forward to getting it out for everybody to use soon.

Thanks,

Ryan

AuraWallet.com

Just read that Litecoin also have their Android wallet. https://play.google.com/store/apps/details?id=de.schildbach.wallet_ltc

@Ryan, @kactech, any progress updates on the Peercoin Mobile/ Android wallet?

Bit of a late reply, but I had the same issue and a possible interim solution. I found using an app like Splashtop Remote very useful. I’m using it on my tablet, but if you have a larger phone (5"+) I bet it would also be acceptable pending native solutions.

For super thin client.

I hear mycelium uses data from blockchain.info for tx and balance. If we have the similar API on a PPCoin block explorer we can just make some adapters to it. Not sure of how to compose and send though, we might have to steal some parts of code from bitcoinj, (which should be compatible with peer coin?)

[quote=“romerun, post:13, topic:1242”]For super thin client.

I hear mycelium uses data from blockchain.info for tx and balance. If we have the similar API on a PPCoin block explorer we can just make some adapters to it. Not sure of how to compose and send though, we might have to steal some parts of code from bitcoinj, (which should be compatible with peer coin?)[/quote]

well I use the mycelium android wallet and forked the repo here ready to port to Peercoin https://github.com/FuzzyBearBTC/android-peercoinwallet

people can donate to support development directly on this repo using peer4commit here http://peer4commit.com/projects/10

Fuzzybear

[quote=“FuzzyBear, post:14, topic:1242”][quote=“romerun, post:13, topic:1242”]For super thin client.

I hear mycelium uses data from blockchain.info for tx and balance. If we have the similar API on a PPCoin block explorer we can just make some adapters to it. Not sure of how to compose and send though, we might have to steal some parts of code from bitcoinj, (which should be compatible with peer coin?)[/quote]

well I use the mycelium android wallet and forked the repo here ready to port to Peercoin https://github.com/FuzzyBearBTC/android-peercoinwallet

people can donate to support development directly on this repo using peer4commit here http://peer4commit.com/projects/10

Fuzzybear[/quote]

Excellent job! I just introduce the peer4commit.com on my weibo: http://weibo.com/3552119670/AA1zdfdjR

FuzzyBear, could you create a myceleum fork for Primecoin on GitHub? That would be awesome for development.

I have made a branch for the Primecoin development https://github.com/FuzzyBearBTC/android-peercoinwallet/tree/primecoin

please read this though before starting any development on the primecoin mycilium wallet https://github.com/FuzzyBearBTC/android-peercoinwallet/issues/13

Fuzzybear

Hi,

I would be interested in creating BitcoinJ fork for PeerCoin.

Could you please clarify few points, please?

Do you think is it possible to create?

Will it be still SPV client without need of gigabytes of data?

Will be possible to have Proof of Stake supported?

If not will it be possible to use at least as SPV client for sending and receiving?

Thanks for clarification.

Regards

[quote=“kac-, post:1, topic:1242”]I want to clarify one part of point 18 of Goals thread http://www.peercointalk.org/index.php?topic=1093.0

Bitcoin wallets for Android are based on BitcoinJ library. There is no simple way to port this library to Peercoin.
BitcoinJ is using Simplified Payment Verification(SPV https://en.bitcoin.it/wiki/Scalability#Simplified_payment_verification), in two words: thin node needs only block headers and merkle tree branch to verify transaction. With Peercoin, for each PoS block, it would also need coinstake, hash of block with coinstake, transactions(with merkle branch) for each coinstake input. It is doable but practically it won’t be SPV anymore.
What we can do with BitcoinJ is to make full Peercoin Java(Android compatible I hope) client. Steps:

  1. Modify network parameters(done)
  2. Implement coinstake verification
  3. Modify H2FullPrunedBlockStore
  4. Implement coinstake generation
    If there would be enough interest, and at least one more Java coder here, we could try to port it.

Porting to Primecoin should be much easier(POW verification partially done)

BitcoinJ, btw great library, without almost any modifications can be used in Peercoin projects to:

  • manage keys
  • receive blocks/transactions from network
  • create and broadcast transactions(also with advanced scripting)
    By joining it with RPC client it can be solid base for advanced projects. If anyone is interested in using it that way- please post here or PM.

Cheers![/quote]

@nov Hi

Do you think is it possible to create?
It's possible to create SPV client for Peercoin but it would be more complex and less secure than SPV with BTC( if written by me).
Will it be still SPV client without need of gigabytes of data?
So far there is no problem with an excess of data PPC on network. However, the faster tx index would be nice.
Will be possible to have Proof of Stake supported?
Yes.
If not will it be possible to use at least as SPV client for sending and receiving?
You can use BitcoinJ for listening (blocks/txs) and sending.

Just to note, it’s my private opinion rather than careful analysis, I don’t exclude anything, please do your own research.
Due to the nature of Peercoin network there isn’t much pressure for SPV implementation IMO.
I’ll push onto the github some BitcoinJ modifications for PPC, probably tomorrow. (yeah, only few modifs, stuck from months)

P.

With watch-only wallet/addresses feature in PPC full client it would be quite easy to create mycelium-like client(more precisely- server implementation) but with private and cheap VPS server side: faster and more secure than any SPV + contribution to the network.

https://github.com/kac-/peercoinj/tree/early-stage , I’ll post example usage later

Hi Kac,

I am testing your peercoinj library.

It looks like that new addresses are generated properly.

But there seems to be some issue to connecting to peercoin network.

It does not start synchronisation of SPV chain.

It throws this exception.

3:03:00.049 [NioClientManager] WARN c.g.bitcoin.core.PeerSocketHandler - [76.74.177.224]:9901 -
java.lang.IllegalArgumentException: null
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:111) ~[guava-16.0.1.jar:na]
at com.google.bitcoin.core.AbstractBlockChain$OrphanBlock.(AbstractBlockChain.java:116) ~[classes/:na]
at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:392) ~[classes/:na]
at com.google.bitcoin.core.AbstractBlockChain.add(AbstractBlockChain.java:252) ~[classes/:na]
at com.google.bitcoin.core.Peer.processHeaders(Peer.java:481) ~[classes/:na]
at com.google.bitcoin.core.Peer.processMessage(Peer.java:323) ~[classes/:na]
at com.google.bitcoin.core.PeerSocketHandler.receiveBytes(PeerSocketHandler.java:139) ~[classes/:na]
at com.google.bitcoin.net.ConnectionHandler.handleKey(ConnectionHandler.java:216) [classes/:na]
at com.google.bitcoin.net.NioClientManager.handleKey(NioClientManager.java:74) [classes/:na]
at com.google.bitcoin.net.NioClientManager.run(NioClientManager.java:110) [classes/:na]
at com.google.common.util.concurrent.AbstractExecutionThreadService$1$2.run(AbstractExecutionThreadService.java:60) [guava-16.0.1.jar:na]
at com.google.common.util.concurrent.Callables$3.run(Callables.java:93) [guava-16.0.1.jar:na]
at java.lang.Thread.run(Thread.java:695) [na:1.6.0_65]
13:03:00.049 [NioClientManager] INFO com.google.bitcoin.core.PeerGroup - [76.74.177.224]:9901: Peer died
13:03:00.050 [NioClientManager] INFO com.google.bitcoin.core.PeerGroup - Download peer died. Picking a new one.

Regards

[quote=“kac-, post:19, topic:1242”]@nov Hi

Do you think is it possible to create?
It's possible to create SPV client for Peercoin but it would be more complex and less secure than SPV with BTC( if written by me).
Will it be still SPV client without need of gigabytes of data?
So far there is no problem with an excess of data PPC on network. However, the faster tx index would be nice.
Will be possible to have Proof of Stake supported?
Yes.
If not will it be possible to use at least as SPV client for sending and receiving?
You can use BitcoinJ for listening (blocks/txs) and sending.

Just to note, it’s my private opinion rather than careful analysis, I don’t exclude anything, please do your own research.
Due to the nature of Peercoin network there isn’t much pressure for SPV implementation IMO.
I’ll push onto the github some BitcoinJ modifications for PPC, probably tomorrow. (yeah, only few modifs, stuck from months)

P.

With watch-only wallet/addresses feature in PPC full client it would be quite easy to create mycelium-like client(more precisely- server implementation) but with private and cheap VPS server side: faster and more secure than any SPV + contribution to the network.

https://github.com/kac-/peercoinj/tree/early-stage , I’ll post example usage later[/quote]