-
Notifications
You must be signed in to change notification settings - Fork 31
Add BIP0322 Proof of Funds to RegisterInputsForNextRoundRequest
#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
base: next-version
Are you sure you want to change the base?
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
Fragile:
|
not clear why ? timestamp should always be smaller than "now". I mean timestamp in the future should always be rejected by the server.
It can be anything, the idea was to set a small enough delta so the proof can't be reused if intercepted. In fact maybe this delta should be the signer's choice / cc @Kukks ? |
Converted to draft, I need to update the BIP322 proof with :
|
After chat, we will not use psbt after all and stay compatible with BIP322. We will insert the data as a json inside the challenge message, something like
|
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