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:
Modify network parameters(done)
Implement coinstake verification
Modify H2FullPrunedBlockStore
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.
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.
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 :
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!
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!
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 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.
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.
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]
[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]
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:
Modify network parameters(done)
Implement coinstake verification
Modify H2FullPrunedBlockStore
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.
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.
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.
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.