-
Notifications
You must be signed in to change notification settings - Fork 35
Add BIP0322 Proof of Funds & implement RegisterIntent
#485
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
Conversation
GetNote
RPCGetNote
RPC
Couldn't one simply use the VTXO ownership proof in itself as a note? The api to exchange a proof for a vtxo is redundant: This flow:
Proposed flow:
|
I agree, but if we do that, we should be able to register also the not expired VTXOs in the same proof no ? If I have 1 VTXO not swept + 1 expired VTXO, I create a proof containing both outpoints and use it as input ? something like: message RegisterInputsForNextRoundRequest {
repeated TaprootTree revealed_taproot_tree = 1; // reveal tapscripts of unspent & not expired vtxos
repeated string notes = 2;
string bip322_signature = 3; // proof of funds for "inputs" array + swept vtxos you want to recover
} |
According to the latest discussion, I've removed the message RegisterInputsForNextRoundRequest {
map<string, Tapscripts> tapscripts = 1;
Bip322Signature bip322_signature = 2;
repeated string notes = 3;
} To register inputs, users must provide a valid BIP322 signature signing a The BIP322 proof of funds tx may include:
|
GetNote
RPCRegisterInputsForNextRoundRequest
@@ -123,11 +109,13 @@ message GetBoardingAddressResponse { | |||
|
|||
/* In-Round Transaction API messages */ | |||
|
|||
message RegisterInputsForNextRoundRequest { | |||
repeated Input inputs = 1; | |||
message RegisterIntentRequest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets not replace it, and only add a new RPC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets not replace it, and only add a new RPC
Ideally we do remove it in the medium term, it's a redundant rpc and keeps duplicate logic around input proofs
…ite db (#544) * Replace boarding descriptor with boarding exit delay (#501) * replace boarding descriptor by boarding exit delay * fix wasm --------- Co-authored-by: altafan <[email protected]> * Add RegisterIntent & Support for BIP0322 proof of funds (#485) * safer forfeitTxsMap.sign * add bip322 package * replace nostr notifications APIs by GetNote RPC + BIP322 proof of funds * fix permissions * update wasm wrappers * update signature_test.go * remove fixture generation * update utils.go * drop entity repo and view * add craftToSign func * make proto * rework message verification * rework RegisterInputsForNextRound, remove GetNote * drop unused functions * remove toVtxoKeys * make genrest * Replace boarding descriptor with boarding exit delay (#501) * replace boarding descriptor by boarding exit delay * fix wasm --------- Co-authored-by: altafan <[email protected]> * implement RegisterIntent * fix GetInfo * revert arkservice.go * allign with next-version GetInfo * revert changes from master * fix ContainsOutput * move Message struct and rename * fix IntentMessage comment * Select --> selectFunds * revert covenantless.go constant change * use time to check exitDelay * check vtxo key * remove unused parser * drop GetNote from permissions.go * run integration CI in every PR * run unit test on every PR * update permisssions.go file * Make changes backward compatible * Fix macaroon permission --------- Co-authored-by: altafan <[email protected]> * Drop covenant packages (#469) * drop covenant/liquid support * go work sync * Replace boarding descriptor with boarding exit delay (#501) * replace boarding descriptor by boarding exit delay * fix wasm --------- Co-authored-by: altafan <[email protected]> * Lint * Update readme * Lint * Fix * Rename files * Polish integration tests * Polish sdk * Fix * Polish --------- Co-authored-by: altafan <[email protected]> * trick * [SDK] SQLite store (#545) * Add SQLite db to sdk * Lint * Fix * Fixes * Fix * Fix makefile * make GetInfoResponse backward compatible * Lint --------- Co-authored-by: Louis Singer <[email protected]> Co-authored-by: Dusan Sekulic <[email protected]>
update: #485 (comment)
This PR deletes the nostr notifications system and replace it by a simple
GetNote
API.OwnershipProof
is also replaced by BIP0322 "Proof of Funds".GetNote
GetNote RPC expects
bip322_signature
and the associatedmessage
. If the signature is valid, the server returns a note where amount = sum of bip322_signature outpoints. The server also mark the VTXOs as spent in DB to prevent cheating.BIP0322 Proof of funds
common.bip322
package is standalone and follows the BIP0322 specificationsThe
message
must be the current Unix timestamp. It is considered valid by the server if and only if it is close to current timestamp.CLI and SDK
sdk.RecoverSweptVtxos
orark recover
CLI command automatically fetch swept and unspent VTXOs, create a BIP0322 signature, fetch the associated note and redeem it.it closes #484
it closes #483
@altafan @Kukks please review