Pooled minting using ROAST on a mobile phone

This idea was first introduced in December of '23, and explained in the following blog post:

https://www.peercoin.net/blog/pooled-minting/

Today, when using threshold signatures on the go (mobile) is very close to reality, let’s expand on this and imagine the workflow.


Example Scenario

Bob, who is a long-time peercoiner has talked his friends into purchasing a small amount of peercoin. He tells them they can also become block producers and be rewarded for it by the Peercoin network. However, they are not really technically literate and do not use desktop computers all that much, and asked Bob if he can mint for them. However, Bob does not want to be responsible for other people’s assets, so he proposes they start a ROAST swarm and mint as a group. From their mobile phones. :smirk:

Let’s imagine how would that work.

  • Participants: Alice, Bob, Charlie, Dave, and Emily.
  • ROAST Setup: 3-of-5 (any 3 of the 5 friends must sign for a valid transaction).
  • Total PPC: 22,500 PPC.
  • UTXOs: 150 * 150 PPC
  • Goal: Pool funds to maximize the Proof-Of-Stake yield and enable less tech literate peercoiners to participate in PoS.

1. Create the 3-of-5 ROAST swarm

  • Generating a group peercoin address:
    Each friend (Alice, Bob, Charlie, Dave, Emily) joins the ROAST swarm in their app and proceed with Distributed Key Generation process (DKG), which yields a shared address.

  • Confirm Setup:
    Bob tests the validity of ROAST address, by making a small deposit (0.1 PPC) and testing spending from it, ensuring that ROAST setup requires 4 out of the 5 signatures to spend funds.

2. Pool 22,500 PPC into the Multisig

  • Initial Deposits:
    Each of the five friends sends their portion of PPC (whatever adds up to 22,500 PPC in total) directly to the newly created ROAST address.
  • Confirm Funds:
    Use a block explorer or the Flutter Wallet interface to see that the multisig address now holds 22,500 PPC.
  • Split UTXOs
    Bob makes a transaction which splits the deposits into 150 UTXOs. 150 * 150 PPC
    Two other friends confirm this transaction, and it is broadcasted to the network. Once confirmed, friends now collectively control 150 maturing UTXOs.

3. Proposing and Creating the Coinstake Transaction

  • Finding a Good Time to Stake
    (perhaps finstake.js can be ported to dart and included into the flutter wallet?)

    Suppose Charlie notices that one of the UTXOs has reached a suitable coin age for staking and has a decent chance of scoring a block. Charlie uses the “Propose Coinstake” feature in the app to create an unsigned coinstake transaction for that UTXO. The transaction includes metadata about the UTXO, stake reward, and potential block timing.

  • Notifying ROAST Participants
    Charlie sends a push notification to Alice, Bob, Dave, and Emily with the details of coinstake proposal.

  • Transaction Signing
    Each participant sees who proposed the transaction (Charlie) and reviews the amounts, timing, and any other relevant info.
    Those who agree (say, Alice, Bob, and Dave) tap “Sign” in their Flutter apps and provide a partial signature for the transaction.
    The signed portions are sent to the ROAST coordinator, which aggregates the signatures.

    As soon as 3 valid signatures are collected (e.g., from Charlie, Alice, and Bob), the coinstake transaction is considered fully signed and can be imported into a minting peercoin node.

4. Importing the Coinstake Transaction into a Peercoin Node

  • Importing coinstake
    Anyone with the fully signed transaction (e.g., Bob) can run:

    peercoin-cli importcoinstake <fully_signed_transaction_in_hex>

    This can be done locally or on a remote Peercoin node with RPC access.

  • Minting
    Once imported, the node automatically attempts to mint.

    If the network accepts the block, the PoS reward is added to the UTXO. All five friends can see that the new block has been found and that the updated balance (original coins plus reward) remains under the 3-of-5 multisig.

1 Like

Anyone can do it but only bob would be able to mint with it, because his address is designated minter and only he has privkey.

1 Like

If Bob is able to operate peercoin-cli, he can operate findstakejs too?
As for code, some code is rewritten in go and as a consequence, and in webassembly too, just in case it was needed in the future…

Yes.

Yep, Bob can be the one operating the findstake on his own and feeding that info into the flutter wallet. I believe less technical people would love to interact with this kind of setup, I can imagine people being pleased with pressing “Sign” on a coinstake transaction - knowing that there is a little financial reward attached to that.

Reason why I think finding stakes on a phone isnt viable is it consumes a decent amount of RAM and CPU to find stakes for the next 20 days. Usually it takes up to 3 hours for an address that has about 100 utxo’s to finish searching.

Most applicable would be the desktop wallet, no?

That, or yet another subscription service which can be queried over an API?

could be a cli without a UI for at home
, but it could be a service in the cloud in a bigger setting including submitting fully signed transaction to the network. Whichever fits the context best.