Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep early and Cashback #448

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

louisinger
Copy link
Collaborator

This PR adds the base building blocks to implement an automated sweep early worker for the server and a cashback system to incentive users to leak their vtxo secret keys.

Changes

  • The server stores in database the musig2 public key for each vtxo tree.
  • The server lets users leak their signing secret keys via GetCashback RPC. SDK has a new GetCashbackNotes method to handle this.
  • The admin is able to sweep a round manually using the CLI, before the expiry, if all the secret keys are known.

Test it yourself

  1. The client settles to join the next round
ark settle

the round txid is 613cf0e583b9d42a5ca123df8b783a223806f0df35ace7d6c473490c3b30ce89

  1. The client leaks the signing key used to sign the shared outputs:
ark cashback --txid 613cf0e583b9d42a5ca123df8b783a223806f0df35ace7d6c473490c3b30ce89

he gets an arknote as reward:

{
	"notes": [
		"arknotePjDXZaZq4jxpgo6YAULuZ2ckP1nnZJNAXpydGFJ47uZDySZQzKAYQ99wAXPAsSCspdNqVF6DFtrZd2bksiU2AiW7tCj1SZ5n4bwebyjH"
	]
}
  1. the admin uses the leaked secret key to sweep the root shared output

The admin can list the "sweepable early" rounds ids.

arkd sweep list

It returns the list of IDs available for sweep early cmd:

4b6c2554-7b86-4a98-8443-86e69a24045c

The admin then trigger sweep early:

arkd sweep round --round-id 4b6c2554-7b86-4a98-8443-86e69a24045c

TODOs

  • Dynamic cashback amount. Now the ark note sent as reward to leak the keys are always 10k sats.
  • Sweep early non-root shared output. That PR allows only the sweep early in case all the private keys are known by the server. If only a part of them have been leaked, the server could use them anyway if it unrolls the vtxo tree.
  • Smart sweep early: spend shared output as input of next rounds (instead of crafting a "sweep transaction" on-demand).

@altafan please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant