Skip to content

Commit cba4892

Browse files
altafanlouisingersekulicd
authored
Add RegisterIntent + BIP0322 Proof of Funds & Drop covenant & SDK SQLite 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]>
1 parent 0b2007c commit cba4892

File tree

176 files changed

+9004
-20309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+9004
-20309
lines changed

.github/workflows/ark.integration.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- master
77
pull_request:
88
branches:
9-
- master
9+
- '*'
1010

1111
jobs:
1212
test:

.github/workflows/ark.unit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- 'common/**'
1111
pull_request:
1212
branches:
13-
- master
13+
- '*'
1414
paths:
1515
- 'server/**'
1616
- 'pkg/client-sdk/**'

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ Welcome to the Ark monorepo, a comprehensive solution for off-chain Bitcoin tran
1919
2020
## Supported Networks and Wallets
2121

22-
| | Covenant-less | Covenant |
23-
|---------|-----------------------------|-----------------------------------------|
24-
| Network | Bitcoin signet, Bitcoin regtest | Liquid, Liquid testnet, Liquid regtest |
25-
| Wallet | Embedded [lnwallet](https://pkg.go.dev/github.com/lightningnetwork/lnd/lnwallet/btcwallet) | [Ocean](https://github.com/vulpemventures/ocean) wallet |
22+
`arkd` supports the following Bitcoin network:
23+
* regtest
24+
* testnet3
25+
* signet
26+
* mutinynet
27+
* mainnet
28+
29+
and uses [lnwallet](https://pkg.go.dev/github.com/lightningnetwork/lnd/lnwallet/btcwallet) as embedded on-chain wallet.
2630

2731
## Usage Documentation
2832

api-spec/openapi/swagger/ark/v1/new_types.swagger.json

Lines changed: 0 additions & 44 deletions
This file was deleted.

api-spec/openapi/swagger/ark/v1/service.swagger.json

Lines changed: 65 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,38 @@
196196
]
197197
}
198198
},
199+
"/v1/round/registerIntent": {
200+
"post": {
201+
"operationId": "ArkService_RegisterIntent",
202+
"responses": {
203+
"200": {
204+
"description": "A successful response.",
205+
"schema": {
206+
"$ref": "#/definitions/v1RegisterIntentResponse"
207+
}
208+
},
209+
"default": {
210+
"description": "An unexpected error response.",
211+
"schema": {
212+
"$ref": "#/definitions/rpcStatus"
213+
}
214+
}
215+
},
216+
"parameters": [
217+
{
218+
"name": "body",
219+
"in": "body",
220+
"required": true,
221+
"schema": {
222+
"$ref": "#/definitions/v1RegisterIntentRequest"
223+
}
224+
}
225+
],
226+
"tags": [
227+
"ArkService"
228+
]
229+
}
230+
},
199231
"/v1/round/registerOutputs": {
200232
"post": {
201233
"operationId": "ArkService_RegisterOutputsForNextRound",
@@ -354,70 +386,6 @@
354386
"ArkService"
355387
]
356388
}
357-
},
358-
"/v1/vtxo/nostr": {
359-
"post": {
360-
"operationId": "ArkService_SetNostrRecipient",
361-
"responses": {
362-
"200": {
363-
"description": "A successful response.",
364-
"schema": {
365-
"$ref": "#/definitions/v1SetNostrRecipientResponse"
366-
}
367-
},
368-
"default": {
369-
"description": "An unexpected error response.",
370-
"schema": {
371-
"$ref": "#/definitions/rpcStatus"
372-
}
373-
}
374-
},
375-
"parameters": [
376-
{
377-
"name": "body",
378-
"in": "body",
379-
"required": true,
380-
"schema": {
381-
"$ref": "#/definitions/v1SetNostrRecipientRequest"
382-
}
383-
}
384-
],
385-
"tags": [
386-
"ArkService"
387-
]
388-
}
389-
},
390-
"/v1/vtxo/nostr/delete": {
391-
"post": {
392-
"operationId": "ArkService_DeleteNostrRecipient",
393-
"responses": {
394-
"200": {
395-
"description": "A successful response.",
396-
"schema": {
397-
"$ref": "#/definitions/v1DeleteNostrRecipientResponse"
398-
}
399-
},
400-
"default": {
401-
"description": "An unexpected error response.",
402-
"schema": {
403-
"$ref": "#/definitions/rpcStatus"
404-
}
405-
}
406-
},
407-
"parameters": [
408-
{
409-
"name": "body",
410-
"in": "body",
411-
"required": true,
412-
"schema": {
413-
"$ref": "#/definitions/v1DeleteNostrRecipientRequest"
414-
}
415-
}
416-
],
417-
"tags": [
418-
"ArkService"
419-
]
420-
}
421389
}
422390
},
423391
"definitions": {
@@ -449,21 +417,17 @@
449417
}
450418
}
451419
},
452-
"v1DeleteNostrRecipientRequest": {
420+
"v1Bip322Signature": {
453421
"type": "object",
454422
"properties": {
455-
"vtxos": {
456-
"type": "array",
457-
"items": {
458-
"type": "object",
459-
"$ref": "#/definitions/v1SignedVtxoOutpoint"
460-
}
423+
"signature": {
424+
"type": "string"
425+
},
426+
"message": {
427+
"type": "string"
461428
}
462429
}
463430
},
464-
"v1DeleteNostrRecipientResponse": {
465-
"type": "object"
466-
},
467431
"v1GetBoardingAddressRequest": {
468432
"type": "object",
469433
"properties": {
@@ -568,6 +532,10 @@
568532
"type": "string",
569533
"format": "int64",
570534
"title": "-1 means no limit (default)"
535+
},
536+
"boardingExitDelay": {
537+
"type": "string",
538+
"format": "int64"
571539
}
572540
}
573541
},
@@ -671,22 +639,6 @@
671639
}
672640
}
673641
},
674-
"v1OwnershipProof": {
675-
"type": "object",
676-
"properties": {
677-
"controlBlock": {
678-
"type": "string"
679-
},
680-
"script": {
681-
"type": "string"
682-
},
683-
"signature": {
684-
"type": "string",
685-
"title": "VTXO outpoint signed with script's secret key"
686-
}
687-
},
688-
"description": "This message is used to prove to the server that the user controls the vtxo without revealing the whole VTXO taproot tree."
689-
},
690642
"v1PingResponse": {
691643
"type": "object"
692644
},
@@ -741,6 +693,29 @@
741693
}
742694
}
743695
},
696+
"v1RegisterIntentRequest": {
697+
"type": "object",
698+
"properties": {
699+
"bip322Signature": {
700+
"$ref": "#/definitions/v1Bip322Signature",
701+
"title": "BIP322 signature embeds the outpoints and the proof of funds"
702+
},
703+
"notes": {
704+
"type": "array",
705+
"items": {
706+
"type": "string"
707+
}
708+
}
709+
}
710+
},
711+
"v1RegisterIntentResponse": {
712+
"type": "object",
713+
"properties": {
714+
"requestId": {
715+
"type": "string"
716+
}
717+
}
718+
},
744719
"v1RegisterOutputsForNextRoundRequest": {
745720
"type": "object",
746721
"properties": {
@@ -876,35 +851,6 @@
876851
}
877852
}
878853
},
879-
"v1SetNostrRecipientRequest": {
880-
"type": "object",
881-
"properties": {
882-
"nostrRecipient": {
883-
"type": "string"
884-
},
885-
"vtxos": {
886-
"type": "array",
887-
"items": {
888-
"type": "object",
889-
"$ref": "#/definitions/v1SignedVtxoOutpoint"
890-
}
891-
}
892-
}
893-
},
894-
"v1SetNostrRecipientResponse": {
895-
"type": "object"
896-
},
897-
"v1SignedVtxoOutpoint": {
898-
"type": "object",
899-
"properties": {
900-
"outpoint": {
901-
"$ref": "#/definitions/v1Outpoint"
902-
},
903-
"proof": {
904-
"$ref": "#/definitions/v1OwnershipProof"
905-
}
906-
}
907-
},
908854
"v1SubmitRedeemTxRequest": {
909855
"type": "object",
910856
"properties": {

api-spec/protobuf/ark/v1/service.proto

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ service ArkService {
2020

2121
/* In-Round Transaction APIs */
2222

23+
rpc RegisterIntent(RegisterIntentRequest) returns (RegisterIntentResponse) {
24+
option (google.api.http) = {
25+
post: "/v1/round/registerIntent"
26+
body: "*"
27+
};
28+
};
2329
rpc RegisterInputsForNextRound(RegisterInputsForNextRoundRequest) returns (RegisterInputsForNextRoundResponse) {
2430
option (google.api.http) = {
2531
post: "/v1/round/registerInputs"
@@ -70,25 +76,11 @@ service ArkService {
7076
};
7177
}
7278

73-
/* Nostr APIs */
74-
7579
rpc GetTransactionsStream(GetTransactionsStreamRequest) returns (stream GetTransactionsStreamResponse) {
7680
option (google.api.http) = {
7781
get: "/v1/transactions"
7882
};
7983
}
80-
rpc SetNostrRecipient(SetNostrRecipientRequest) returns (SetNostrRecipientResponse) {
81-
option (google.api.http) = {
82-
post: "/v1/vtxo/nostr"
83-
body: "*"
84-
};
85-
}
86-
rpc DeleteNostrRecipient(DeleteNostrRecipientRequest) returns (DeleteNostrRecipientResponse) {
87-
option (google.api.http) = {
88-
post: "/v1/vtxo/nostr/delete"
89-
body: "*"
90-
};
91-
}
9284
}
9385

9486
message GetInfoRequest {}
@@ -108,6 +100,7 @@ message GetInfoResponse {
108100
int64 utxo_max_amount = 13; // -1 means no limit (default), 0 means boarding not allowed
109101
int64 vtxo_min_amount = 14; // -1 means native dust limit (default)
110102
int64 vtxo_max_amount = 15; // -1 means no limit (default)
103+
int64 boarding_exit_delay = 16;
111104
}
112105

113106
message GetBoardingAddressRequest {
@@ -123,6 +116,15 @@ message GetBoardingAddressResponse {
123116

124117
/* In-Round Transaction API messages */
125118

119+
message RegisterIntentRequest {
120+
// BIP322 signature embeds the outpoints and the proof of funds
121+
Bip322Signature bip322_signature = 1;
122+
repeated string notes = 2;
123+
}
124+
message RegisterIntentResponse {
125+
string request_id = 1;
126+
}
127+
126128
message RegisterInputsForNextRoundRequest {
127129
repeated Input inputs = 1;
128130
repeated string notes = 2;
@@ -200,14 +202,3 @@ message GetTransactionsStreamResponse {
200202
RedeemTransaction redeem = 2;
201203
}
202204
}
203-
204-
message SetNostrRecipientRequest {
205-
string nostr_recipient = 1;
206-
repeated SignedVtxoOutpoint vtxos = 2;
207-
}
208-
message SetNostrRecipientResponse {}
209-
210-
message DeleteNostrRecipientRequest {
211-
repeated SignedVtxoOutpoint vtxos = 1;
212-
}
213-
message DeleteNostrRecipientResponse {}

0 commit comments

Comments
 (0)