From f09dba8971c590de1a0840e12932cac4b9b329b6 Mon Sep 17 00:00:00 2001 From: louisinger Date: Tue, 13 May 2025 14:42:54 +0200 Subject: [PATCH 1/4] refactor: arknote are fake vtxos --- .../openapi/swagger/ark/v1/admin.swagger.json | 6 - .../swagger/ark/v1/service.swagger.json | 12 - api-spec/protobuf/ark/v1/service.proto | 2 - api-spec/protobuf/ark/v1/types.proto | 7 +- api-spec/protobuf/gen/ark/v1/service.pb.go | 441 +++++++++--------- api-spec/protobuf/gen/ark/v1/types.pb.go | 181 ++++--- common/note/note.go | 183 +++++--- common/note/note_test.go | 241 ++-------- common/tree/script.go | 2 +- pkg/client-sdk/client.go | 164 +++++-- pkg/client-sdk/client/client.go | 3 - pkg/client-sdk/client/grpc/client.go | 13 - pkg/client-sdk/client/rest/client.go | 15 - ..._register_inputs_for_next_round_request.go | 3 - .../models/v1_register_intent_request.go | 3 - .../wallet/singlekey/bitcoin_wallet.go | 3 +- server/internal/core/application/admin.go | 38 +- server/internal/core/application/service.go | 114 ++--- server/internal/core/application/types.go | 3 - server/internal/core/application/utils.go | 50 +- server/internal/core/domain/note_repo.go | 9 - server/internal/core/ports/repo_manager.go | 1 - server/internal/core/ports/wallet.go | 2 - .../infrastructure/db/badger/note_repo.go | 93 ---- server/internal/infrastructure/db/service.go | 25 - .../infrastructure/db/service_test.go | 28 -- .../20250513103501_drop_note.down.sql | 3 + .../migration/20250513103501_drop_note.up.sql | 1 + .../infrastructure/db/sqlite/note_repo.go | 58 --- .../interface/grpc/handlers/arkservice.go | 80 +--- .../interface/grpc/handlers/parser.go | 25 - 31 files changed, 683 insertions(+), 1126 deletions(-) delete mode 100644 server/internal/core/domain/note_repo.go delete mode 100644 server/internal/infrastructure/db/badger/note_repo.go create mode 100644 server/internal/infrastructure/db/sqlite/migration/20250513103501_drop_note.down.sql create mode 100644 server/internal/infrastructure/db/sqlite/migration/20250513103501_drop_note.up.sql delete mode 100644 server/internal/infrastructure/db/sqlite/note_repo.go diff --git a/api-spec/openapi/swagger/ark/v1/admin.swagger.json b/api-spec/openapi/swagger/ark/v1/admin.swagger.json index 519431a96..be491f47b 100644 --- a/api-spec/openapi/swagger/ark/v1/admin.swagger.json +++ b/api-spec/openapi/swagger/ark/v1/admin.swagger.json @@ -561,12 +561,6 @@ "$ref": "#/definitions/v1RequestInput" } }, - "notes": { - "type": "array", - "items": { - "type": "string" - } - }, "signingType": { "type": "string" }, diff --git a/api-spec/openapi/swagger/ark/v1/service.swagger.json b/api-spec/openapi/swagger/ark/v1/service.swagger.json index 4d0bd04e0..23f7d44e9 100644 --- a/api-spec/openapi/swagger/ark/v1/service.swagger.json +++ b/api-spec/openapi/swagger/ark/v1/service.swagger.json @@ -676,12 +676,6 @@ "type": "object", "$ref": "#/definitions/v1Input" } - }, - "notes": { - "type": "array", - "items": { - "type": "string" - } } } }, @@ -699,12 +693,6 @@ "bip322Signature": { "$ref": "#/definitions/v1Bip322Signature", "title": "BIP322 signature embeds the outpoints and the proof of funds" - }, - "notes": { - "type": "array", - "items": { - "type": "string" - } } } }, diff --git a/api-spec/protobuf/ark/v1/service.proto b/api-spec/protobuf/ark/v1/service.proto index bc69cb7a9..02ae57c34 100644 --- a/api-spec/protobuf/ark/v1/service.proto +++ b/api-spec/protobuf/ark/v1/service.proto @@ -119,7 +119,6 @@ message GetBoardingAddressResponse { message RegisterIntentRequest { // BIP322 signature embeds the outpoints and the proof of funds Bip322Signature bip322_signature = 1; - repeated string notes = 2; } message RegisterIntentResponse { string request_id = 1; @@ -127,7 +126,6 @@ message RegisterIntentResponse { message RegisterInputsForNextRoundRequest { repeated Input inputs = 1; - repeated string notes = 2; } message RegisterInputsForNextRoundResponse { string request_id = 1; diff --git a/api-spec/protobuf/ark/v1/types.proto b/api-spec/protobuf/ark/v1/types.proto index 2ae1a9f48..3a77a5708 100644 --- a/api-spec/protobuf/ark/v1/types.proto +++ b/api-spec/protobuf/ark/v1/types.proto @@ -118,10 +118,9 @@ message TxRequestInfo { repeated Output receivers = 3; repeated RequestInput inputs = 4; repeated RequestInput boarding_inputs = 5; - repeated string notes = 6; - string signing_type = 7; - repeated string cosigners_public_keys = 8; - int64 last_ping = 9; + string signing_type = 6; + repeated string cosigners_public_keys = 7; + int64 last_ping = 8; } message RequestInput { diff --git a/api-spec/protobuf/gen/ark/v1/service.pb.go b/api-spec/protobuf/gen/ark/v1/service.pb.go index 6ffd27c43..5416129a1 100644 --- a/api-spec/protobuf/gen/ark/v1/service.pb.go +++ b/api-spec/protobuf/gen/ark/v1/service.pb.go @@ -369,7 +369,6 @@ type RegisterIntentRequest struct { // BIP322 signature embeds the outpoints and the proof of funds Bip322Signature *Bip322Signature `protobuf:"bytes,1,opt,name=bip322_signature,json=bip322Signature,proto3" json:"bip322_signature,omitempty"` - Notes []string `protobuf:"bytes,2,rep,name=notes,proto3" json:"notes,omitempty"` } func (x *RegisterIntentRequest) Reset() { @@ -411,13 +410,6 @@ func (x *RegisterIntentRequest) GetBip322Signature() *Bip322Signature { return nil } -func (x *RegisterIntentRequest) GetNotes() []string { - if x != nil { - return x.Notes - } - return nil -} - type RegisterIntentResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -471,7 +463,6 @@ type RegisterInputsForNextRoundRequest struct { unknownFields protoimpl.UnknownFields Inputs []*Input `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` - Notes []string `protobuf:"bytes,2,rep,name=notes,proto3" json:"notes,omitempty"` } func (x *RegisterInputsForNextRoundRequest) Reset() { @@ -513,13 +504,6 @@ func (x *RegisterInputsForNextRoundRequest) GetInputs() []*Input { return nil } -func (x *RegisterInputsForNextRoundRequest) GetNotes() []string { - if x != nil { - return x.Notes - } - return nil -} - type RegisterInputsForNextRoundResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1553,232 +1537,229 @@ var file_ark_v1_service_proto_rawDesc = []byte{ 0x72, 0x69, 0x70, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x70, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x74, 0x61, 0x70, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x73, 0x42, 0x0e, 0x0a, - 0x0c, 0x74, 0x61, 0x70, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x22, 0x71, 0x0a, + 0x0c, 0x74, 0x61, 0x70, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x22, 0x5b, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x10, 0x62, 0x69, 0x70, 0x33, 0x32, 0x32, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x69, 0x70, 0x33, 0x32, 0x32, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0f, 0x62, 0x69, 0x70, 0x33, 0x32, - 0x32, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, - 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x74, 0x65, 0x73, - 0x22, 0x37, 0x0a, 0x16, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, + 0x32, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x37, 0x0a, 0x16, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x49, 0x64, 0x22, 0x4a, 0x0a, 0x21, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, + 0x6e, 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, + 0x31, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x22, + 0x43, 0x0a, 0x22, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, + 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x49, 0x64, 0x22, 0x5d, 0x0a, 0x06, 0x4d, 0x75, 0x73, 0x69, 0x67, 0x32, 0x12, 0x32, + 0x0a, 0x15, 0x63, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x63, + 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6c, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, + 0x41, 0x6c, 0x6c, 0x22, 0xa5, 0x01, 0x0a, 0x22, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, + 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x60, 0x0a, 0x21, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, - 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, - 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x06, 0x69, - 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x22, 0x43, 0x0a, 0x22, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, 0x72, - 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, - 0x22, 0x5d, 0x0a, 0x06, 0x4d, 0x75, 0x73, 0x69, 0x67, 0x32, 0x12, 0x32, 0x0a, 0x15, 0x63, 0x6f, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, - 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x63, 0x6f, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1f, - 0x0a, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x41, 0x6c, 0x6c, 0x22, - 0xa5, 0x01, 0x0a, 0x22, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, - 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x12, - 0x2b, 0x0a, 0x06, 0x6d, 0x75, 0x73, 0x69, 0x67, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x75, 0x73, 0x69, 0x67, 0x32, 0x48, - 0x00, 0x52, 0x06, 0x6d, 0x75, 0x73, 0x69, 0x67, 0x32, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, - 0x5f, 0x6d, 0x75, 0x73, 0x69, 0x67, 0x32, 0x22, 0x25, 0x0a, 0x23, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, - 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6d, - 0x0a, 0x17, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x6e, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x6f, 0x75, - 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x6f, 0x75, - 0x6e, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, - 0x74, 0x72, 0x65, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x74, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x1a, 0x0a, - 0x18, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x79, 0x0a, 0x1b, 0x53, 0x75, 0x62, - 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x6f, 0x75, 0x6e, - 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x6f, 0x75, 0x6e, - 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x74, - 0x72, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x72, 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x22, 0x1e, 0x0a, 0x1c, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, - 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x1d, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x66, 0x65, 0x69, 0x74, 0x54, 0x78, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x5f, 0x66, 0x6f, 0x72, 0x66, 0x65, 0x69, 0x74, 0x5f, 0x74, 0x78, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x66, 0x65, 0x69, - 0x74, 0x54, 0x78, 0x73, 0x12, 0x2b, 0x0a, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x72, - 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x78, 0x88, 0x01, - 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x75, - 0x6e, 0x64, 0x5f, 0x74, 0x78, 0x22, 0x20, 0x0a, 0x1e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x66, 0x65, 0x69, 0x74, 0x54, 0x78, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0xa7, 0x03, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x12, 0x72, - 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, - 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x11, 0x72, 0x6f, 0x75, 0x6e, 0x64, - 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x0f, - 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x7a, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x0c, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x66, 0x61, - 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x61, 0x72, 0x6b, - 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x48, - 0x00, 0x52, 0x0b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x40, - 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x48, 0x00, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, - 0x12, 0x6f, 0x0a, 0x1e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, - 0x67, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x4e, 0x6f, - 0x6e, 0x63, 0x65, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x48, 0x00, 0x52, 0x1b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x69, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x07, 0x6f, 0x75, 0x74, + 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x72, 0x6b, + 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x06, 0x6d, 0x75, 0x73, 0x69, 0x67, 0x32, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x75, 0x73, + 0x69, 0x67, 0x32, 0x48, 0x00, 0x52, 0x06, 0x6d, 0x75, 0x73, 0x69, 0x67, 0x32, 0x88, 0x01, 0x01, + 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6d, 0x75, 0x73, 0x69, 0x67, 0x32, 0x22, 0x25, 0x0a, 0x23, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, + 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x6d, 0x0a, 0x17, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, + 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, + 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, + 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x65, + 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, + 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x79, 0x0a, + 0x1b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x12, + 0x27, 0x0a, 0x0f, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x72, 0x65, 0x65, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x1e, 0x0a, 0x1c, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x1d, 0x53, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x66, 0x65, 0x69, 0x74, + 0x54, 0x78, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x73, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x66, 0x6f, 0x72, 0x66, 0x65, 0x69, 0x74, 0x5f, 0x74, 0x78, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x46, 0x6f, + 0x72, 0x66, 0x65, 0x69, 0x74, 0x54, 0x78, 0x73, 0x12, 0x2b, 0x0a, 0x0f, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x6e, 0x64, + 0x54, 0x78, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x78, 0x22, 0x20, 0x0a, 0x1e, 0x53, 0x75, 0x62, + 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x66, 0x65, 0x69, 0x74, + 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x0a, 0x15, 0x47, + 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0xa7, 0x03, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x4f, 0x0a, 0x12, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x72, + 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x11, 0x72, + 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x46, 0x0a, 0x0f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x7a, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x72, 0x6b, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x46, + 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x0c, 0x72, 0x6f, 0x75, 0x6e, + 0x64, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x61, 0x69, + 0x6c, 0x65, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x61, 0x69, 0x6c, + 0x65, 0x64, 0x12, 0x40, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x6e, + 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x72, 0x6b, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x69, 0x67, + 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x6f, 0x0a, 0x1e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x73, 0x69, + 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x61, + 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x42, 0x07, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x2c, 0x0a, 0x0b, 0x50, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x0e, 0x0a, 0x0c, 0x50, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x0a, 0x15, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x52, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x5f, 0x74, 0x78, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x54, 0x78, 0x22, 0x56, - 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x54, 0x78, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x5f, 0x72, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x5f, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x52, 0x65, 0x64, 0x65, 0x65, 0x6d, - 0x54, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x22, 0x1e, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x8c, 0x01, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, - 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x48, 0x00, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x33, 0x0a, 0x06, 0x72, 0x65, - 0x64, 0x65, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x72, 0x6b, - 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x42, - 0x04, 0x0a, 0x02, 0x74, 0x78, 0x32, 0xcd, 0x0b, 0x0a, 0x0a, 0x41, 0x72, 0x6b, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x16, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, - 0x66, 0x6f, 0x12, 0x74, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, - 0x67, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x61, 0x72, - 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a, 0x01, 0x2a, 0x22, 0x0c, 0x2f, 0x76, 0x31, 0x2f, - 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x74, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x2e, 0x61, 0x72, 0x6b, - 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x72, 0x6b, 0x2e, - 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x98, - 0x01, 0x0a, 0x1a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, - 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x29, 0x2e, + 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x1b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x53, + 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x2c, + 0x0a, 0x0b, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x0e, 0x0a, 0x0c, + 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x0a, 0x15, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x54, 0x78, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x5f, + 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x64, 0x65, 0x65, 0x6d, + 0x54, 0x78, 0x22, 0x56, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x64, 0x65, + 0x65, 0x6d, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x10, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x5f, 0x74, 0x78, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x52, 0x65, + 0x64, 0x65, 0x65, 0x6d, 0x54, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x22, 0x1e, 0x0a, 0x1c, 0x47, 0x65, + 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x8c, 0x01, 0x0a, 0x1d, 0x47, + 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x05, + 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x72, + 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x33, + 0x0a, 0x06, 0x72, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x64, + 0x65, 0x65, 0x6d, 0x42, 0x04, 0x0a, 0x02, 0x74, 0x78, 0x32, 0xcd, 0x0b, 0x0a, 0x0a, 0x41, 0x72, + 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x72, + 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x76, + 0x31, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x74, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x61, + 0x72, 0x64, 0x69, 0x6e, 0x67, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x2e, 0x61, + 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x22, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x61, 0x72, + 0x64, 0x69, 0x6e, 0x67, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a, 0x01, 0x2a, 0x22, 0x0c, + 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x74, 0x0a, 0x0e, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1d, + 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x49, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, + 0x75, 0x6e, 0x64, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x12, 0x98, 0x01, 0x0a, 0x1a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, - 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, - 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x9c, 0x01, 0x0a, 0x1b, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, 0x72, - 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x2a, 0x2e, 0x61, 0x72, 0x6b, 0x2e, + 0x64, 0x12, 0x29, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, 0x74, + 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x61, + 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, + 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, + 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x9c, 0x01, + 0x0a, 0x1b, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x2a, 0x2e, + 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x46, 0x6f, - 0x72, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x22, 0x19, 0x2f, - 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x12, 0x7d, 0x0a, 0x10, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x61, - 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, - 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, - 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, - 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, + 0x2a, 0x22, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x12, 0x7d, 0x0a, 0x10, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, + 0x12, 0x1f, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x54, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, + 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x74, 0x72, 0x65, 0x65, 0x2f, 0x73, + 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x8d, 0x01, 0x0a, 0x14, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, + 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x61, 0x72, 0x6b, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x74, 0x72, 0x65, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, - 0x74, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x8d, 0x01, 0x0a, 0x14, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x12, 0x23, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, - 0x54, 0x72, 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x75, 0x62, 0x6d, 0x69, 0x74, 0x54, 0x72, 0x65, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x75, 0x6e, - 0x64, 0x2f, 0x74, 0x72, 0x65, 0x65, 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x8e, 0x01, 0x0a, 0x16, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x66, 0x65, 0x69, 0x74, 0x54, - 0x78, 0x73, 0x12, 0x25, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, - 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x66, 0x65, 0x69, 0x74, 0x54, - 0x78, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x61, 0x72, 0x6b, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x46, - 0x6f, 0x72, 0x66, 0x65, 0x69, 0x74, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, 0x76, - 0x31, 0x2f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x46, 0x6f, - 0x72, 0x66, 0x65, 0x69, 0x74, 0x54, 0x78, 0x73, 0x12, 0x65, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1d, 0x2e, 0x61, 0x72, 0x6b, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x72, 0x6b, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x0c, 0x12, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x30, 0x01, 0x12, - 0x56, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x13, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x61, - 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, - 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x70, 0x69, 0x6e, 0x67, 0x2f, 0x7b, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x69, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6d, 0x69, - 0x74, 0x52, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x54, 0x78, 0x12, 0x1d, 0x2e, 0x61, 0x72, 0x6b, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x54, - 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x54, 0x78, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, - 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x2d, - 0x74, 0x78, 0x12, 0x80, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x24, 0x2e, 0x61, - 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x30, 0x01, 0x42, 0x92, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x72, - 0x6b, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x61, 0x72, 0x6b, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x61, 0x72, 0x6b, - 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x72, 0x6b, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x72, - 0x6b, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x41, 0x72, 0x6b, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x06, 0x41, 0x72, 0x6b, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x41, 0x72, - 0x6b, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x07, 0x41, 0x72, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x8e, 0x01, 0x0a, 0x16, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x66, + 0x65, 0x69, 0x74, 0x54, 0x78, 0x73, 0x12, 0x25, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x66, + 0x65, 0x69, 0x74, 0x54, 0x78, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, + 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x66, 0x65, 0x69, 0x74, 0x54, 0x78, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, + 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x73, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x46, 0x6f, 0x72, 0x66, 0x65, 0x69, 0x74, 0x54, 0x78, 0x73, 0x12, 0x65, 0x0a, 0x0e, + 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1d, + 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, + 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x12, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x73, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x13, 0x2e, 0x61, 0x72, + 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x14, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, + 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x70, 0x69, 0x6e, 0x67, 0x2f, 0x7b, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x69, 0x0a, 0x0e, 0x53, + 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x64, 0x65, 0x65, 0x6d, 0x54, 0x78, 0x12, 0x1d, 0x2e, + 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x64, + 0x65, 0x65, 0x6d, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x61, + 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x64, 0x65, + 0x65, 0x6d, 0x54, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x64, + 0x65, 0x65, 0x6d, 0x2d, 0x74, 0x78, 0x12, 0x80, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x12, 0x24, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x30, 0x01, 0x42, 0x92, 0x01, 0x0a, 0x0a, 0x63, 0x6f, + 0x6d, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x6b, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x61, 0x72, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x72, 0x6b, 0x2f, 0x76, + 0x31, 0x3b, 0x61, 0x72, 0x6b, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x06, + 0x41, 0x72, 0x6b, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x41, 0x72, 0x6b, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x12, 0x41, 0x72, 0x6b, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x41, 0x72, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api-spec/protobuf/gen/ark/v1/types.pb.go b/api-spec/protobuf/gen/ark/v1/types.pb.go index 9a8f2c69a..9aa3ca1e8 100644 --- a/api-spec/protobuf/gen/ark/v1/types.pb.go +++ b/api-spec/protobuf/gen/ark/v1/types.pb.go @@ -1120,10 +1120,9 @@ type TxRequestInfo struct { Receivers []*Output `protobuf:"bytes,3,rep,name=receivers,proto3" json:"receivers,omitempty"` Inputs []*RequestInput `protobuf:"bytes,4,rep,name=inputs,proto3" json:"inputs,omitempty"` BoardingInputs []*RequestInput `protobuf:"bytes,5,rep,name=boarding_inputs,json=boardingInputs,proto3" json:"boarding_inputs,omitempty"` - Notes []string `protobuf:"bytes,6,rep,name=notes,proto3" json:"notes,omitempty"` - SigningType string `protobuf:"bytes,7,opt,name=signing_type,json=signingType,proto3" json:"signing_type,omitempty"` - CosignersPublicKeys []string `protobuf:"bytes,8,rep,name=cosigners_public_keys,json=cosignersPublicKeys,proto3" json:"cosigners_public_keys,omitempty"` - LastPing int64 `protobuf:"varint,9,opt,name=last_ping,json=lastPing,proto3" json:"last_ping,omitempty"` + SigningType string `protobuf:"bytes,6,opt,name=signing_type,json=signingType,proto3" json:"signing_type,omitempty"` + CosignersPublicKeys []string `protobuf:"bytes,7,rep,name=cosigners_public_keys,json=cosignersPublicKeys,proto3" json:"cosigners_public_keys,omitempty"` + LastPing int64 `protobuf:"varint,8,opt,name=last_ping,json=lastPing,proto3" json:"last_ping,omitempty"` } func (x *TxRequestInfo) Reset() { @@ -1193,13 +1192,6 @@ func (x *TxRequestInfo) GetBoardingInputs() []*RequestInput { return nil } -func (x *TxRequestInfo) GetNotes() []string { - if x != nil { - return x.Notes - } - return nil -} - func (x *TxRequestInfo) GetSigningType() string { if x != nil { return x.SigningType @@ -1732,7 +1724,7 @@ var file_ark_v1_types_proto_rawDesc = []byte{ 0x0a, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x77, 0x65, 0x65, 0x70, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x73, 0x22, 0xe3, 0x02, 0x0a, 0x0d, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, + 0x73, 0x22, 0xcd, 0x02, 0x0a, 0x0d, 0x54, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, @@ -1745,89 +1737,88 @@ var file_ark_v1_types_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x0e, 0x62, - 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x14, 0x0a, - 0x05, 0x6e, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, - 0x74, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x69, - 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x63, 0x6f, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, - 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x63, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, - 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, - 0x73, 0x74, 0x5f, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, - 0x61, 0x73, 0x74, 0x50, 0x69, 0x6e, 0x67, 0x22, 0x4e, 0x0a, 0x0c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x76, - 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x76, 0x6f, 0x75, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xff, 0x02, 0x0a, 0x16, 0x52, 0x6f, 0x75, 0x6e, - 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x78, 0x12, 0x29, 0x0a, - 0x09, 0x76, 0x74, 0x78, 0x6f, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0c, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x52, 0x08, - 0x76, 0x74, 0x78, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x12, 0x2c, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, - 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2b, 0x0a, 0x12, 0x6d, 0x69, 0x6e, 0x5f, 0x72, 0x65, - 0x6c, 0x61, 0x79, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x46, 0x65, 0x65, 0x52, - 0x61, 0x74, 0x65, 0x12, 0x5e, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x73, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, - 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x6e, 0x61, - 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x1a, 0x54, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, - 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, - 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x44, 0x0a, 0x13, 0x52, 0x6f, 0x75, - 0x6e, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x78, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x78, 0x69, 0x64, 0x22, - 0x35, 0x0a, 0x0b, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xb8, 0x01, 0x0a, 0x11, 0x52, 0x6f, 0x75, 0x6e, 0x64, - 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x11, - 0x63, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x73, 0x50, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x3a, 0x0a, 0x12, 0x75, 0x6e, 0x73, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x76, 0x74, 0x78, 0x6f, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x54, - 0x72, 0x65, 0x65, 0x52, 0x10, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x74, 0x78, - 0x6f, 0x54, 0x72, 0x65, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0f, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x54, - 0x78, 0x22, 0x53, 0x0a, 0x20, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, - 0x67, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x6e, 0x6f, - 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x65, 0x65, - 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x2a, 0x98, 0x01, 0x0a, 0x0a, 0x52, 0x6f, 0x75, 0x6e, 0x64, - 0x53, 0x74, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x52, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x53, - 0x54, 0x41, 0x47, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x47, - 0x45, 0x5f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, - 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, - 0x46, 0x49, 0x4e, 0x41, 0x4c, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x19, - 0x0a, 0x15, 0x52, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x49, - 0x4e, 0x41, 0x4c, 0x49, 0x5a, 0x45, 0x44, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x4f, 0x55, - 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, - 0x04, 0x42, 0x90, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, - 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x6b, 0x2d, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x61, 0x72, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, - 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, 0x6e, - 0x2f, 0x61, 0x72, 0x6b, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x72, 0x6b, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x41, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x41, 0x72, 0x6b, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x41, - 0x72, 0x6b, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x41, 0x72, 0x6b, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x41, 0x72, 0x6b, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x21, 0x0a, + 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x32, 0x0a, 0x15, 0x63, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x5f, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x13, 0x63, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x70, 0x69, 0x6e, + 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x50, 0x69, 0x6e, + 0x67, 0x22, 0x4e, 0x0a, 0x0c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x70, 0x75, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x78, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x04, 0x76, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x22, 0xff, 0x02, 0x0a, 0x16, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, + 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x78, 0x12, 0x29, 0x0a, 0x09, 0x76, 0x74, 0x78, 0x6f, 0x5f, + 0x74, 0x72, 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x72, 0x6b, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x52, 0x08, 0x76, 0x74, 0x78, 0x6f, 0x54, 0x72, + 0x65, 0x65, 0x12, 0x2c, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x72, 0x65, 0x65, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, + 0x12, 0x2b, 0x0a, 0x12, 0x6d, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x66, 0x65, + 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6d, 0x69, + 0x6e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x46, 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, 0x12, 0x5e, 0x0a, + 0x10, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, + 0x2e, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, 0x63, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x54, 0x0a, + 0x14, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, + 0x4f, 0x75, 0x74, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x44, 0x0a, 0x13, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x6e, 0x61, + 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x6f, + 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x78, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x78, 0x69, 0x64, 0x22, 0x35, 0x0a, 0x0b, 0x52, 0x6f, 0x75, + 0x6e, 0x64, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x22, 0xb8, 0x01, 0x0a, 0x11, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, + 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x72, 0x73, 0x5f, 0x70, 0x75, 0x62, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x10, 0x63, 0x6f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x50, 0x75, 0x62, 0x6b, + 0x65, 0x79, 0x73, 0x12, 0x3a, 0x0a, 0x12, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, + 0x76, 0x74, 0x78, 0x6f, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x52, 0x10, 0x75, + 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x74, 0x78, 0x6f, 0x54, 0x72, 0x65, 0x65, 0x12, + 0x2a, 0x0a, 0x11, 0x75, 0x6e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x75, 0x6e, + 0x64, 0x5f, 0x74, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x75, 0x6e, 0x73, 0x69, + 0x67, 0x6e, 0x65, 0x64, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x78, 0x22, 0x53, 0x0a, 0x20, 0x52, + 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x4e, 0x6f, 0x6e, 0x63, 0x65, + 0x73, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x72, 0x65, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x73, + 0x2a, 0x98, 0x01, 0x0a, 0x0a, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x67, 0x65, 0x12, + 0x1b, 0x0a, 0x17, 0x52, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, + 0x52, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x52, 0x45, 0x47, 0x49, + 0x53, 0x54, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x4f, + 0x55, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x49, 0x4e, 0x41, 0x4c, 0x49, + 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x4f, 0x55, 0x4e, + 0x44, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x49, 0x4e, 0x41, 0x4c, 0x49, 0x5a, 0x45, + 0x44, 0x10, 0x03, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x53, 0x54, 0x41, + 0x47, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x42, 0x90, 0x01, 0x0a, 0x0a, + 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x72, 0x6b, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x6b, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x61, 0x72, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x72, 0x6b, 0x2f, 0x76, + 0x31, 0x3b, 0x61, 0x72, 0x6b, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa, 0x02, 0x06, + 0x41, 0x72, 0x6b, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x41, 0x72, 0x6b, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x12, 0x41, 0x72, 0x6b, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x41, 0x72, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/note/note.go b/common/note/note.go index b894b9b20..adbce2470 100644 --- a/common/note/note.go +++ b/common/note/note.go @@ -1,43 +1,44 @@ package note import ( + "bytes" "crypto/rand" "crypto/sha256" "encoding/binary" "fmt" "strings" + "github.com/ark-network/ark/common" + "github.com/ark-network/ark/common/bip322" + "github.com/ark-network/ark/common/tree" "github.com/btcsuite/btcd/btcutil/base58" + "github.com/btcsuite/btcd/txscript" + "github.com/btcsuite/btcd/wire" ) -const noteHRP = "arknote" +const ( + preimageSize = 32 + noteHRP = "arknote" + fakeOutpointOutputIndex = uint32(0) +) -// Note represents a note signed by the issuer +// Note contains the data of a note type Note struct { - Data - Signature []byte -} - -// Data contains the data of a note -type Data struct { - ID uint64 - Value uint32 + Preimage []byte + Value uint32 } -// New generate a new note data struct with a random ID and the given value -// it must be signed by the issuer and then converted to a Note using Data.ToNote(signature) -func New(value uint32) (*Data, error) { - randomBytes := make([]byte, 8) - _, err := rand.Read(randomBytes) +// New generate a new note data struct with a random preimage and the given value +func New(value uint32) (*Note, error) { + randomPreimage := make([]byte, preimageSize) + _, err := rand.Read(randomPreimage) if err != nil { - return nil, fmt.Errorf("failed to generate random ID: %w", err) + return nil, fmt.Errorf("failed to generate random preimage: %w", err) } - id := binary.BigEndian.Uint64(randomBytes) - - return &Data{ - ID: id, - Value: value, + return &Note{ + Preimage: randomPreimage, + Value: value, }, nil } @@ -62,66 +63,132 @@ func NewFromString(s string) (*Note, error) { return note, nil } -// Serialize converts Data to a byte slice -func (n *Data) Serialize() []byte { - buf := make([]byte, 12) - binary.BigEndian.PutUint64(buf[:8], n.ID) - binary.BigEndian.PutUint32(buf[8:], n.Value) +// Serialize converts Note's data to a byte slice +func (n *Note) Serialize() []byte { + buf := make([]byte, preimageSize+4) + copy(buf[:preimageSize], n.Preimage) + binary.BigEndian.PutUint32(buf[preimageSize:], n.Value) return buf } // Deserialize converts a byte slice to Data -func (n *Data) Deserialize(data []byte) error { - if len(data) != 12 { - return fmt.Errorf("invalid data length: expected 12 bytes, got %d", len(data)) +func (n *Note) Deserialize(data []byte) error { + if len(data) != preimageSize+4 { + return fmt.Errorf("invalid data length: expected %d bytes, got %d", preimageSize+4, len(data)) } - n.ID = binary.BigEndian.Uint64(data[:8]) - n.Value = binary.BigEndian.Uint32(data[8:]) + n.Preimage = data[:preimageSize] + n.Value = binary.BigEndian.Uint32(data[preimageSize:]) return nil } -// Hash returns the SHA256 hash of the serialized Data -func (n *Data) Hash() []byte { - hash := sha256.Sum256(n.Serialize()) - return hash[:] +// String converts the Note to a base58 encoded string with HRP +func (n Note) String() string { + return noteHRP + base58.Encode(n.Serialize()) } -// Serialize converts the Note to a byte slice -func (n *Note) Serialize() []byte { - detailsBytes := n.Data.Serialize() - return append(detailsBytes, n.Signature...) +func (n Note) PreimageHash() [32]byte { + return sha256.Sum256(n.Preimage) } -// Deserialize converts a byte slice to a Note -func (n *Note) Deserialize(data []byte) error { - if len(data) < 12 { - return fmt.Errorf("invalid data length: expected at least 12 bytes, got %d", len(data)) +func (n Note) VtxoScript() tree.TapscriptsVtxoScript { + // this vtxo script is not valid because it doesn't contain any CHECKSIG + // Validate() will always fail + // that's not a problem because none of the real vtxos will be locked by that script + // it's a way to allow fake "note vtxo" to be standard in the bip322 proof + return tree.TapscriptsVtxoScript{ + Closures: []tree.Closure{&NoteClosure{PreimageHash: n.PreimageHash()}}, } +} - dataCopy := &Data{} - if err := dataCopy.Deserialize(data[:12]); err != nil { - return err +func (n Note) BIP322Input() (*bip322.Input, error) { + vtxoScript := n.VtxoScript() + taprootKey, _, err := vtxoScript.TapTree() + if err != nil { + return nil, fmt.Errorf("failed to get taproot key: %w", err) } - n.Data = *dataCopy + p2trPkScript, err := common.P2TRScript(taprootKey) + if err != nil { + return nil, fmt.Errorf("failed to get p2tr pk script: %w", err) + } - if len(data) > 12 { - n.Signature = data[12:] + return &bip322.Input{ + OutPoint: &wire.OutPoint{ + Hash: n.PreimageHash(), + Index: fakeOutpointOutputIndex, + }, + Sequence: wire.MaxTxInSequenceNum, + WitnessUtxo: &wire.TxOut{ + PkScript: p2trPkScript, + Value: int64(n.Value), + }, + }, nil +} + +// implements tree.Closure interface, +// can't be used in a classic vtxo script but only in the fake vtxo note script +type NoteClosure struct { + PreimageHash [32]byte +} + +// Script returns the tapscript for the note closure +func (n *NoteClosure) Script() ([]byte, error) { + return txscript.NewScriptBuilder(). + AddOp(txscript.OP_SHA256). + AddData(n.PreimageHash[:]). + AddOp(txscript.OP_EQUAL). + Script() +} + +// Decode attempts to decode a script into a NoteClosure +func (n *NoteClosure) Decode(script []byte) (bool, error) { + tokenizer := txscript.MakeScriptTokenizer(0, script) + + if !tokenizer.Next() || tokenizer.Opcode() != txscript.OP_SHA256 { + return false, nil } - return nil + if !tokenizer.Next() || len(tokenizer.Data()) != 32 { + return false, nil + } + copy(n.PreimageHash[:], tokenizer.Data()) + + if !tokenizer.Next() || tokenizer.Opcode() != txscript.OP_EQUAL { + return false, nil + } + + if tokenizer.Next() { + return false, nil + } + + rebuiltScript, err := n.Script() + if err != nil { + return false, fmt.Errorf("failed to rebuild script: %w", err) + } + + if !bytes.Equal(rebuiltScript, script) { + return false, nil + } + return true, nil } -// String converts the Note to a base58 encoded string with HRP -func (n Note) String() string { - return noteHRP + base58.Encode(n.Serialize()) +// WitnessSize returns the size of the witness data excluding the control block and script +func (n *NoteClosure) WitnessSize(_ ...int) int { + return 32 // preimage is always 32 bytes } -// ToNote creates a Note from Data with the given signature -func (n *Data) ToNote(signature []byte) *Note { - return &Note{ - Data: *n, - Signature: signature, +// Witness returns the witness stack for spending the fake vtxo note +func (n *NoteClosure) Witness(controlBlock []byte, opts map[string][]byte) (wire.TxWitness, error) { + preimage, ok := opts["preimage"] + if !ok { + return nil, fmt.Errorf("missing preimage for hash %x", n.PreimageHash) } + + script, err := n.Script() + if err != nil { + return nil, fmt.Errorf("failed to generate script: %w", err) + } + + return wire.TxWitness{preimage, script, controlBlock}, nil } diff --git a/common/note/note_test.go b/common/note/note_test.go index 89bc7c5f2..fba16c048 100644 --- a/common/note/note_test.go +++ b/common/note/note_test.go @@ -1,7 +1,7 @@ package note_test import ( - "encoding/binary" + "encoding/hex" "math" "testing" @@ -9,95 +9,6 @@ import ( "github.com/stretchr/testify/require" ) -func TestDataSerialize(t *testing.T) { - tests := []struct { - name string - note note.Data - want []byte - }{ - { - name: "Valid note", - note: note.Data{ID: 12345678901234567890, Value: 100}, - want: func() []byte { - buf := make([]byte, 12) - binary.BigEndian.PutUint64(buf[:8], 12345678901234567890) - binary.BigEndian.PutUint32(buf[8:], 100) - return buf - }(), - }, - { - name: "Zero values", - note: note.Data{ID: 0, Value: 0}, - want: make([]byte, 12), - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := tt.note.Serialize() - require.Equal(t, tt.want, got) - }) - } -} - -func TestDataDeserialize(t *testing.T) { - tests := []struct { - name string - data []byte - want note.Data - wantErr bool - }{ - { - name: "Valid data", - data: func() []byte { - buf := make([]byte, 12) - binary.BigEndian.PutUint64(buf[:8], 12345678901234567890) - binary.BigEndian.PutUint32(buf[8:], 100) - return buf - }(), - want: note.Data{ID: 12345678901234567890, Value: 100}, - wantErr: false, - }, - { - name: "Zero values", - data: make([]byte, 12), - want: note.Data{ID: 0, Value: 0}, - wantErr: false, - }, - { - name: "Invalid data length", - data: []byte{1, 2, 3}, - want: note.Data{}, - wantErr: true, - }, - { - name: "Nil data", - data: nil, - want: note.Data{}, - wantErr: true, - }, - { - name: "Too long data", - data: make([]byte, 20), - want: note.Data{}, - wantErr: true, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - var got note.Data - err := got.Deserialize(tt.data) - if tt.wantErr { - require.Error(t, err) - } else { - require.NoError(t, err) - require.Equal(t, tt.want, got) - } - }) - } -} - func TestNew(t *testing.T) { tests := []struct { name string @@ -130,151 +41,67 @@ func TestNew(t *testing.T) { require.NoError(t, err) require.NotNil(t, got) require.Equal(t, tt.value, got.Value) - require.NotZero(t, got.ID) + require.NotNil(t, got.Preimage) + require.Len(t, got.Preimage, 32) } }) } // Test for uniqueness of IDs - t.Run("Unique IDs", func(t *testing.T) { - idSet := make(map[uint64]bool) + t.Run("Unique preimage", func(t *testing.T) { + preimageSet := make(map[string]bool) for i := 0; i < 1_000_000; i++ { data, err := note.New(100) require.NoError(t, err) - require.False(t, idSet[data.ID], "Generated duplicate ID: %v", data.ID) - idSet[data.ID] = true + require.False(t, preimageSet[hex.EncodeToString(data.Preimage)], "Generated duplicate preimage: %x", data.Preimage) + preimageSet[hex.EncodeToString(data.Preimage)] = true } }) } -func TestNoteRoundtrip(t *testing.T) { - tests := []struct { - name string - note note.Note - }{ - { - name: "Valid note", - note: note.Note{ - Data: note.Data{ID: 12345678901234567890, Value: 100}, - Signature: []byte("test signature"), - }, - }, - { - name: "Note with nil signature", - note: note.Note{ - Data: note.Data{ID: 67899, Value: 200000}, - Signature: nil, - }, - }, - { - name: "Note with large signature", - note: note.Note{ - Data: note.Data{ID: 67899, Value: 200}, - Signature: make([]byte, 1000), - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - serialized := tt.note.Serialize() - - var deserialized note.Note - err := deserialized.Deserialize(serialized) - require.NoError(t, err) - require.Equal(t, tt.note.Data.ID, deserialized.Data.ID) - require.Equal(t, tt.note.Data.Value, deserialized.Data.Value) - require.Equal(t, tt.note.Signature, deserialized.Signature) - }) - } -} - func TestNewFromString(t *testing.T) { tests := []struct { - str string - expectedID uint64 - expectedValue uint32 + str string + expectedPreimage []byte + expectedValue uint32 }{ { - str: "arknote2iqtKmdVWDNo8aXT7HHWLxcZovseWBqAEf2Q4SwhqMQHRyuhLQSukyNtmJzrnPHEcLGDsvxVsmndw8e8m4AFy2FbSw8Q6MA6uYCZQeY6", - expectedID: 0x11d2a03264d0efd3, + str: "arknote8rFzGqZsG9RCLripA6ez8d2hQEzFKsqCeiSnXhQj56Ysw7ZQT", + expectedPreimage: []byte{ + 0x11, 0xd2, 0xa0, 0x32, 0x64, 0xd0, 0xef, 0xd3, + 0x11, 0xd2, 0xa0, 0x32, 0x64, 0xd0, 0xef, 0xd3, + 0x11, 0xd2, 0xa0, 0x32, 0x64, 0xd0, 0xef, 0xd3, + 0x11, 0xd2, 0xa0, 0x32, 0x64, 0xd0, 0xef, 0xd3, + }, expectedValue: 900000, }, { - str: "arknoteDyxaEGpxuGNNy4L6B45vDarZzY8ChLST7AD4VYshjCNByz1p3ayWwrK6QN696Us1uMwP6frxBu171ESuqU1AjrWzXgoPYnNoogLbcYps", - expectedID: 0x8668bd0f324d8ec7, + str: "arknoteSkB92YpWm4Q2ijQHH34cqbKkCZWszsiQgHVjtNeFF2Cwp59D", + expectedPreimage: []byte{ + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, + 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, + }, expectedValue: 1828932, }, } for _, tt := range tests { t.Run(tt.str, func(t *testing.T) { - note, err := note.NewFromString(tt.str) - require.NoError(t, err) - require.NotNil(t, note) - require.Len(t, note.Signature, 64) - require.Equal(t, tt.expectedID, note.Data.ID) - require.Equal(t, tt.expectedValue, note.Data.Value) - }) - } -} + n := ¬e.Note{ + Preimage: tt.expectedPreimage, + Value: tt.expectedValue, + } -func TestDataToNote(t *testing.T) { - tests := []struct { - name string - data note.Data - signature []byte - }{ - { - name: "Valid note data and signature", - data: note.Data{ID: 12345678901234567890, Value: 100}, - signature: []byte("test signature"), - }, - { - name: "Valid note data with empty signature", - data: note.Data{ID: 65992, Value: 200}, - signature: []byte{}, - }, - } + str := n.String() + require.Equal(t, str, tt.str) - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - note := tt.data.ToNote(tt.signature) + note, err := note.NewFromString(tt.str) + require.NoError(t, err) require.NotNil(t, note) - require.Equal(t, tt.data, note.Data) - require.Equal(t, tt.signature, note.Signature) - }) - } -} - -func TestDataHash(t *testing.T) { - tests := []struct { - name string - data note.Data - }{ - { - name: "Valid note data", - data: note.Data{ID: 12345678901234567890, Value: 100}, - }, - { - name: "Zero values", - data: note.Data{ID: 0, Value: 0}, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - hash := tt.data.Hash() - require.Len(t, hash, 32) - - // Verify that the hash is deterministic - hash2 := tt.data.Hash() - require.Equal(t, hash, hash2) - - // Verify that different details produce different hashes - differentData := note.Data{ID: tt.data.ID + 1, Value: tt.data.Value} - differentHash := differentData.Hash() - require.NotEqual(t, hash, differentHash) + require.Equal(t, tt.expectedPreimage, note.Preimage) + require.Equal(t, tt.expectedValue, note.Value) }) } } diff --git a/common/tree/script.go b/common/tree/script.go index 0497ca7e1..cbd35c23d 100644 --- a/common/tree/script.go +++ b/common/tree/script.go @@ -49,7 +49,7 @@ type Closure interface { // extraWitnessSize is here to count the condition witness size // or any other witness size that can't be computed from the script WitnessSize(extraWitnessSize ...int) int - Witness(controlBlock []byte, signatures map[string][]byte) (wire.TxWitness, error) + Witness(controlBlock []byte, opts map[string][]byte) (wire.TxWitness, error) } // MultisigClosure is a closure that contains a list of public keys and a diff --git a/pkg/client-sdk/client.go b/pkg/client-sdk/client.go index 8798f075c..e2f9a9048 100644 --- a/pkg/client-sdk/client.go +++ b/pkg/client-sdk/client.go @@ -1469,6 +1469,7 @@ func (a *covenantlessArkClient) makeBIP322Signature( tapscripts map[string][]string, outputs []client.Output, musig2Data *tree.Musig2, + notesWitnesses map[int][]byte, ) (string, string, error) { validAt := time.Now() expireAt := validAt.Add(2 * time.Minute).Unix() @@ -1559,7 +1560,7 @@ func (a *covenantlessArkClient) makeBIP322Signature( proof = (*bip322.FullProof)(signedProofTx) - sig, err := proof.Signature() + sig, err := proof.Signature(finalizeWithNotes(notesWitnesses)) if err != nil { return "", "", err } @@ -1648,7 +1649,7 @@ func (a *covenantlessArkClient) joinRoundWithRetry( ctx context.Context, notes []string, outputs []client.Output, options SettleOptions, selectedCoins []client.TapscriptsVtxo, selectedBoardingCoins []types.Utxo, ) (string, error) { - inputs, exitLeaves, tapscripts, err := toBIP322Inputs(selectedBoardingCoins, selectedCoins) + inputs, exitLeaves, tapscripts, notesWitnesses, err := toBIP322Inputs(selectedBoardingCoins, selectedCoins, notes) if err != nil { return "", err } @@ -1663,52 +1664,23 @@ func (a *covenantlessArkClient) joinRoundWithRetry( SigningType: signingType, } - var bip322Signature string - var bip322Message string - - if len(inputs) > 0 { - bip322Signature, bip322Message, err = a.makeBIP322Signature( - inputs, exitLeaves, tapscripts, - outputs, musig2Data, - ) - if err != nil { - return "", err - } + bip322Signature, bip322Message, err := a.makeBIP322Signature( + inputs, exitLeaves, tapscripts, + outputs, musig2Data, notesWitnesses, + ) + if err != nil { + return "", err } maxRetry := 3 retryCount := 0 var roundErr error for retryCount < maxRetry { - var requestID string - var err error - - if len(inputs) > 0 { - requestID, err = a.client.RegisterIntent( - ctx, bip322Signature, bip322Message, - ) - if err != nil { - return "", err - } - } - - if len(notes) > 0 { - if len(requestID) > 0 { - return "", fmt.Errorf("cannot register notes and inputs at the same time") - } - - requestID, err = a.client.RegisterNotesForNextRound( - ctx, notes, - ) - if err != nil { - return "", err - } - - if err := a.client.RegisterOutputsForNextRound( - ctx, requestID, outputs, musig2Data, - ); err != nil { - return "", err - } + requestID, err := a.client.RegisterIntent( + ctx, bip322Signature, bip322Message, + ) + if err != nil { + return "", err } log.Infof("registered inputs and outputs with request id: %s", requestID) @@ -3454,14 +3426,20 @@ func extractExitPath(tapscripts []string) ([]byte, *common.TaprootMerkleProof, u return pkScript, leafProof, sequence, nil } -func toBIP322Inputs(boardingUtxos []types.Utxo, vtxos []client.TapscriptsVtxo) ([]bip322.Input, []*common.TaprootMerkleProof, map[string][]string, error) { +// convert inputs to BIP322 inputs and return all the data needed to sign and proof PSBT +func toBIP322Inputs( + boardingUtxos []types.Utxo, vtxos []client.TapscriptsVtxo, + notes []string, +) ([]bip322.Input, []*common.TaprootMerkleProof, map[string][]string, map[int][]byte, error) { inputs := make([]bip322.Input, 0, len(boardingUtxos)+len(vtxos)) exitLeaves := make([]*common.TaprootMerkleProof, 0, len(boardingUtxos)+len(vtxos)) tapscripts := make(map[string][]string) + notesWitnesses := make(map[int][]byte) + for _, coin := range vtxos { hash, err := chainhash.NewHashFromStr(coin.Txid) if err != nil { - return nil, nil, nil, err + return nil, nil, nil, nil, err } outpoint := wire.NewOutPoint(hash, coin.VOut) @@ -3469,7 +3447,7 @@ func toBIP322Inputs(boardingUtxos []types.Utxo, vtxos []client.TapscriptsVtxo) ( pkScript, leafProof, vtxoSequence, err := extractExitPath(coin.Tapscripts) if err != nil { - return nil, nil, nil, err + return nil, nil, nil, nil, err } exitLeaves = append(exitLeaves, leafProof) @@ -3487,7 +3465,7 @@ func toBIP322Inputs(boardingUtxos []types.Utxo, vtxos []client.TapscriptsVtxo) ( for _, coin := range boardingUtxos { hash, err := chainhash.NewHashFromStr(coin.Txid) if err != nil { - return nil, nil, nil, err + return nil, nil, nil, nil, err } outpoint := wire.NewOutPoint(hash, coin.VOut) @@ -3495,7 +3473,7 @@ func toBIP322Inputs(boardingUtxos []types.Utxo, vtxos []client.TapscriptsVtxo) ( pkScript, leafProof, vtxoSequence, err := extractExitPath(coin.Tapscripts) if err != nil { - return nil, nil, nil, err + return nil, nil, nil, nil, err } exitLeaves = append(exitLeaves, leafProof) @@ -3510,7 +3488,72 @@ func toBIP322Inputs(boardingUtxos []types.Utxo, vtxos []client.TapscriptsVtxo) ( }) } - return inputs, exitLeaves, tapscripts, nil + nextInputIndex := len(inputs) + if nextInputIndex > 0 { + // if there is non-notes inputs, count the extra bip322 input + nextInputIndex++ + } + + for _, n := range notes { + parsedNote, err := note.NewFromString(n) + if err != nil { + return nil, nil, nil, nil, err + } + + input, err := parsedNote.BIP322Input() + if err != nil { + return nil, nil, nil, nil, err + } + + inputs = append(inputs, *input) + + vtxoScript := parsedNote.VtxoScript() + + _, taprootTree, err := vtxoScript.TapTree() + if err != nil { + return nil, nil, nil, nil, err + } + + exitScript, err := vtxoScript.Closures[0].Script() + if err != nil { + return nil, nil, nil, nil, err + } + + exitLeaf := txscript.NewBaseTapLeaf(exitScript) + leafProof, err := taprootTree.GetTaprootMerkleProof(exitLeaf.TapHash()) + if err != nil { + return nil, nil, nil, nil, fmt.Errorf("failed to get taproot merkle proof: %s", err) + } + + witness, err := vtxoScript.Closures[0].Witness(leafProof.ControlBlock, map[string][]byte{ + "preimage": parsedNote.Preimage, + }) + if err != nil { + return nil, nil, nil, nil, fmt.Errorf("failed to get witness: %s", err) + } + + var witnessBuf bytes.Buffer + if err := psbt.WriteTxWitness(&witnessBuf, witness); err != nil { + return nil, nil, nil, nil, fmt.Errorf("failed to write witness: %s", err) + } + + notesWitnesses[nextInputIndex] = witnessBuf.Bytes() + nextInputIndex++ + // if the note vtxo is the first input, it will be used twice + if nextInputIndex == 1 { + notesWitnesses[nextInputIndex] = witnessBuf.Bytes() + nextInputIndex++ + } + + exitLeaves = append(exitLeaves, leafProof) + encodedVtxoScript, err := vtxoScript.Encode() + if err != nil { + return nil, nil, nil, nil, err + } + tapscripts[input.OutPoint.String()] = encodedVtxoScript + } + + return inputs, exitLeaves, tapscripts, notesWitnesses, nil } func getOffchainBalanceDetails(amountByExpiration map[int64]uint64) (int64, []VtxoDetails) { nextExpiration := int64(0) @@ -3574,3 +3617,28 @@ func toTypesVtxo(src client.Vtxo) types.Vtxo { CreatedAt: src.CreatedAt, } } + +// custom BIP322 finalizer function handling note vtxo inputs +func finalizeWithNotes(notesWitnesses map[int][]byte) func(ptx *psbt.Packet) error { + return func(ptx *psbt.Packet) error { + for i, input := range ptx.Inputs { + witness, isNote := notesWitnesses[i] + if !isNote { + ok, err := psbt.MaybeFinalize(ptx, i) + if err != nil { + return fmt.Errorf("failed to finalize input %d: %s", i, err) + } + if !ok { + return fmt.Errorf("failed to finalize input %d", i) + } + continue + } + + newInput := psbt.NewPsbtInput(nil, input.WitnessUtxo) + newInput.FinalScriptWitness = witness + ptx.Inputs[i] = *newInput + } + + return nil + } +} diff --git a/pkg/client-sdk/client/client.go b/pkg/client-sdk/client/client.go index d402b20f1..8d8ff15d4 100644 --- a/pkg/client-sdk/client/client.go +++ b/pkg/client-sdk/client/client.go @@ -37,9 +37,6 @@ type TransportClient interface { RegisterIntent( ctx context.Context, signature, message string, ) (string, error) - RegisterNotesForNextRound( - ctx context.Context, notes []string, - ) (string, error) RegisterOutputsForNextRound( ctx context.Context, requestID string, outputs []Output, musig2 *tree.Musig2, ) error diff --git a/pkg/client-sdk/client/grpc/client.go b/pkg/client-sdk/client/grpc/client.go index cc437e0ef..b73f18115 100644 --- a/pkg/client-sdk/client/grpc/client.go +++ b/pkg/client-sdk/client/grpc/client.go @@ -132,19 +132,6 @@ func (a *grpcClient) RegisterIntent( return resp.GetRequestId(), nil } -func (a *grpcClient) RegisterNotesForNextRound( - ctx context.Context, notes []string, -) (string, error) { - req := &arkv1.RegisterIntentRequest{ - Notes: notes, - } - resp, err := a.svc.RegisterIntent(ctx, req) - if err != nil { - return "", err - } - return resp.GetRequestId(), nil -} - func (a *grpcClient) RegisterOutputsForNextRound( ctx context.Context, requestID string, outputs []client.Output, musig2 *tree.Musig2, ) error { diff --git a/pkg/client-sdk/client/rest/client.go b/pkg/client-sdk/client/rest/client.go index 07fd6099b..82c99a47a 100644 --- a/pkg/client-sdk/client/rest/client.go +++ b/pkg/client-sdk/client/rest/client.go @@ -204,21 +204,6 @@ func (a *restClient) RegisterIntent( return resp.Payload.RequestID, nil } -func (a *restClient) RegisterNotesForNextRound( - ctx context.Context, notes []string, -) (string, error) { - body := &models.V1RegisterIntentRequest{ - Notes: notes, - } - resp, err := a.svc.ArkServiceRegisterIntent( - ark_service.NewArkServiceRegisterIntentParams().WithBody(body), - ) - if err != nil { - return "", err - } - return resp.Payload.RequestID, nil -} - func (a *restClient) RegisterOutputsForNextRound( ctx context.Context, requestID string, outputs []client.Output, musig2 *tree.Musig2, ) error { diff --git a/pkg/client-sdk/client/rest/service/models/v1_register_inputs_for_next_round_request.go b/pkg/client-sdk/client/rest/service/models/v1_register_inputs_for_next_round_request.go index 96e0d4a17..cc0a48779 100644 --- a/pkg/client-sdk/client/rest/service/models/v1_register_inputs_for_next_round_request.go +++ b/pkg/client-sdk/client/rest/service/models/v1_register_inputs_for_next_round_request.go @@ -21,9 +21,6 @@ type V1RegisterInputsForNextRoundRequest struct { // inputs Inputs []*V1Input `json:"inputs"` - - // notes - Notes []string `json:"notes"` } // Validate validates this v1 register inputs for next round request diff --git a/pkg/client-sdk/client/rest/service/models/v1_register_intent_request.go b/pkg/client-sdk/client/rest/service/models/v1_register_intent_request.go index 467e908f6..8e32b4b0d 100644 --- a/pkg/client-sdk/client/rest/service/models/v1_register_intent_request.go +++ b/pkg/client-sdk/client/rest/service/models/v1_register_intent_request.go @@ -20,9 +20,6 @@ type V1RegisterIntentRequest struct { // BIP322 signature embeds the outpoints and the proof of funds Bip322Signature *V1Bip322Signature `json:"bip322Signature,omitempty"` - - // notes - Notes []string `json:"notes"` } // Validate validates this v1 register intent request diff --git a/pkg/client-sdk/wallet/singlekey/bitcoin_wallet.go b/pkg/client-sdk/wallet/singlekey/bitcoin_wallet.go index d0042a307..acd23582d 100644 --- a/pkg/client-sdk/wallet/singlekey/bitcoin_wallet.go +++ b/pkg/client-sdk/wallet/singlekey/bitcoin_wallet.go @@ -201,7 +201,8 @@ func (s *bitcoinWallet) SignTransaction( for _, leaf := range input.TaprootLeafScript { closure, err := tree.DecodeClosure(leaf.Script) if err != nil { - return "", err + // in case of invalid script, we skip signing the input + continue } sign := false diff --git a/server/internal/core/application/admin.go b/server/internal/core/application/admin.go index 3c629bc2f..f81acfbaa 100644 --- a/server/internal/core/application/admin.go +++ b/server/internal/core/application/admin.go @@ -2,8 +2,11 @@ package application import ( "context" + "encoding/hex" + "time" "github.com/ark-network/ark/common/note" + "github.com/ark-network/ark/server/internal/core/domain" "github.com/ark-network/ark/server/internal/core/ports" ) @@ -187,22 +190,47 @@ func (a *adminService) GetWalletStatus(ctx context.Context) (*WalletStatus, erro }, nil } +// CreateNotes generates random notes and create the associated vtxos in the database func (a *adminService) CreateNotes(ctx context.Context, value uint32, quantity int) ([]string, error) { notes := make([]string, 0, quantity) + vtxos := make([]domain.Vtxo, 0, quantity) + + now := time.Now().Unix() + for i := 0; i < quantity; i++ { - data, err := note.New(value) + note, err := note.New(value) if err != nil { return nil, err } - noteHash := data.Hash() - - signature, err := a.walletSvc.SignMessage(ctx, noteHash) + bip322Input, err := note.BIP322Input() if err != nil { return nil, err } - note := data.ToNote(signature) + + vtxo := domain.Vtxo{ + VtxoKey: domain.VtxoKey{ + Txid: bip322Input.OutPoint.Hash.String(), + VOut: bip322Input.OutPoint.Index, + }, + Amount: uint64(note.Value), + PubKey: hex.EncodeToString(bip322Input.WitnessUtxo.PkScript[2:]), + RoundTxid: "", + SpentBy: "", + Spent: false, + Redeemed: false, + Swept: false, + CreatedAt: now, + RedeemTx: "", + } + notes = append(notes, note.String()) + vtxos = append(vtxos, vtxo) + } + + vtxoRepo := a.repoManager.Vtxos() + if err := vtxoRepo.AddVtxos(ctx, vtxos); err != nil { + return nil, err } return notes, nil diff --git a/server/internal/core/application/service.go b/server/internal/core/application/service.go index b3bff5066..8fa0f2e84 100644 --- a/server/internal/core/application/service.go +++ b/server/internal/core/application/service.go @@ -13,7 +13,6 @@ import ( "github.com/ark-network/ark/common" "github.com/ark-network/ark/common/bip322" - "github.com/ark-network/ark/common/note" "github.com/ark-network/ark/common/tree" "github.com/ark-network/ark/server/internal/core/domain" "github.com/ark-network/ark/server/internal/core/ports" @@ -319,6 +318,11 @@ func (s *covenantlessService) SubmitRedeemTx( return "", "", fmt.Errorf("vtxo already swept") } + isNoteVtxo := len(vtxo.RoundTxid) == 0 + if isNoteVtxo { + return "", "", fmt.Errorf("vtxo '%s' is a note, can't be spent in ark transaction", vtxo.String()) + } + vtxoScript, err := tree.ParseVtxoScript(tapscripts) if err != nil { return "", "", fmt.Errorf("failed to parse vtxo script: %s", err) @@ -608,53 +612,16 @@ func (s *covenantlessService) GetBoardingAddress( return } -func (s *covenantlessService) SpendNotes(ctx context.Context, notes []note.Note) (string, error) { - notesRepo := s.repoManager.Notes() - - for _, note := range notes { - // verify the note signature - hash := note.Hash() - - valid, err := s.wallet.VerifyMessageSignature(ctx, hash, note.Signature) - if err != nil { - return "", fmt.Errorf("failed to verify note signature: %s", err) - } - - if !valid { - return "", fmt.Errorf("invalid note signature %s", note) - } - - // verify that the note is spendable - spent, err := notesRepo.Contains(ctx, note.ID) - if err != nil { - return "", fmt.Errorf("failed to check if note is spent: %s", err) - } - - if spent { - return "", fmt.Errorf("note already spent: %s", note) - } - } - - request, err := domain.NewTxRequest(make([]domain.Vtxo, 0)) - if err != nil { - return "", fmt.Errorf("failed to create tx request: %s", err) - } - - if err := s.txRequests.pushWithNotes(*request, notes); err != nil { - return "", fmt.Errorf("failed to push tx requests: %s", err) - } - - return request.Id, nil -} - func (s *covenantlessService) RegisterIntent(ctx context.Context, bip322signature bip322.Signature, message tree.IntentMessage) (string, error) { - vtxoKeys := make([]domain.VtxoKey, 0) - // the vtxo to swap for new ones + // vtxoKeysInputs keeps track of the vtxos that are inputs of the intent + vtxoKeysInputs := make([]domain.VtxoKey, 0) + // the vtxo to swap for new ones, require forfeit transactions vtxosInputs := make([]domain.Vtxo, 0) // the boarding utxos to add in the commitment tx boardingInputs := make([]ports.BoardingInput, 0) - // the vtxos to recover (swept but unspent) - recoveredVtxos := make([]domain.Vtxo, 0) + // custodial vtxos = the vtxos to recover (swept but unspent) + note vtxos + // do not require forfeit transactions + custodialVtxos := make([]domain.Vtxo, 0) boardingTxs := make(map[string]wire.MsgTx, 0) // txid -> txhex @@ -808,9 +775,14 @@ func (s *covenantlessService) RegisterIntent(ctx context.Context, bip322signatur PkScript: pkScript, } - if vtxo.Swept { + vtxoKeysInputs = append(vtxoKeysInputs, vtxo.VtxoKey) + + isNoteVtxo := len(vtxo.RoundTxid) == 0 + + if vtxo.Swept || isNoteVtxo { // the user is asking for recovery of the vtxo - recoveredVtxos = append(recoveredVtxos, vtxo) + // or try to redeem a note vtxo + custodialVtxos = append(custodialVtxos, vtxo) continue } @@ -835,11 +807,10 @@ func (s *covenantlessService) RegisterIntent(ctx context.Context, bip322signatur } if !bytes.Equal(schnorr.SerializePubKey(tapKey), schnorr.SerializePubKey(expectedTapKey)) { - return "", fmt.Errorf("descriptor does not match vtxo pubkey") + return "", fmt.Errorf("tapscripts does not match vtxo taproot pubkey") } vtxosInputs = append(vtxosInputs, vtxo) - vtxoKeys = append(vtxoKeys, vtxo.VtxoKey) } prevoutFetcher := txscript.NewMultiPrevOutFetcher(prevouts) @@ -859,10 +830,6 @@ func (s *covenantlessService) RegisterIntent(ctx context.Context, bip322signatur } if bip322signature.ContainsOutputs() { - if err != nil { - return "", fmt.Errorf("unable to verify outputs amount, failed to get dust: %s", err) - } - hasOffChainReceiver := false receivers := make([]domain.Receiver, 0) @@ -940,11 +907,12 @@ func (s *covenantlessService) RegisterIntent(ctx context.Context, bip322signatur } } - if err := s.txRequests.push(*request, boardingInputs, recoveredVtxos, message.Musig2Data); err != nil { + if err := s.txRequests.push(*request, boardingInputs, custodialVtxos, message.Musig2Data); err != nil { return "", err } - s.roundInputs.add(vtxoKeys) + // prevent the vtxos from being spent in a concurrent intent + s.roundInputs.add(vtxoKeysInputs) return request.Id, nil } @@ -1412,7 +1380,6 @@ func (s *covenantlessService) GetTxRequestQueue( Receivers: receivers, Inputs: request.Inputs, BoardingInputs: request.boardingInputs, - Notes: request.notes, LastPing: request.pingTimestamp, SigningType: signingType, Cosigners: cosigners, @@ -1601,8 +1568,7 @@ func (s *covenantlessService) startFinalization(roundEndTime time.Time) { roundRemainingDuration := time.Duration((s.roundInterval/3)*2-1) * time.Second thirdOfRemainingDuration := roundRemainingDuration / 3 - var notes []note.Note - var recoveredVtxos []domain.Vtxo + var custodialVtxos []domain.Vtxo var roundAborted bool var vtxoKeys []domain.VtxoKey defer func() { @@ -1622,7 +1588,7 @@ func (s *covenantlessService) startFinalization(roundEndTime time.Time) { return } - s.finalizeRound(notes, recoveredVtxos, roundEndTime) + s.finalizeRound(custodialVtxos, roundEndTime) }() if round.IsFailed() { @@ -1644,15 +1610,18 @@ func (s *covenantlessService) startFinalization(roundEndTime time.Time) { if num > s.roundMaxParticipantsCount { num = s.roundMaxParticipantsCount } - requests, boardingInputs, redeeemedNotes, musig2data, vtxosToRecover := s.txRequests.pop(num) + requests, boardingInputs, musig2data, recoveredAndNoteVtxos := s.txRequests.pop(num) // save notes and recovered vtxos for finalize function - notes = redeeemedNotes - recoveredVtxos = vtxosToRecover + custodialVtxos = recoveredAndNoteVtxos + for _, req := range requests { for _, in := range req.Inputs { vtxoKeys = append(vtxoKeys, in.VtxoKey) } } + for _, vtxo := range custodialVtxos { + vtxoKeys = append(vtxoKeys, vtxo.VtxoKey) + } s.numOfBoardingInputsMtx.Lock() s.numOfBoardingInputs = len(boardingInputs) s.numOfBoardingInputsMtx.Unlock() @@ -1882,7 +1851,7 @@ func (s *covenantlessService) propagateRoundSigningNoncesGeneratedEvent(combined s.eventsCh <- ev } -func (s *covenantlessService) finalizeRound(notes []note.Note, recoveredVtxos []domain.Vtxo, roundEndTime time.Time) { +func (s *covenantlessService) finalizeRound(custodialVtxos []domain.Vtxo, roundEndTime time.Time) { defer s.startRound() ctx := context.Background() @@ -2030,25 +1999,18 @@ func (s *covenantlessService) finalizeRound(notes []note.Note, recoveredVtxos [] return } - // mark the notes as spent - for _, note := range notes { - if err := s.repoManager.Notes().Add(ctx, note.ID); err != nil { - log.WithError(err).Warn("failed to mark note as spent") - } - } - - recoveredVtxosKeys := make([]domain.VtxoKey, 0) - for _, vtxo := range recoveredVtxos { - recoveredVtxosKeys = append(recoveredVtxosKeys, vtxo.VtxoKey) + custodialVtxosKeys := make([]domain.VtxoKey, 0) + for _, vtxo := range custodialVtxos { + custodialVtxosKeys = append(custodialVtxosKeys, vtxo.VtxoKey) } - // mark the recovered vtxos as spent - if err := s.repoManager.Vtxos().SpendVtxos(ctx, recoveredVtxosKeys, round.Txid); err != nil { - log.WithError(err).Warn("failed to mark recovered vtxos as spent") + // mark the recovered and notes vtxos as spent + if err := s.repoManager.Vtxos().SpendVtxos(ctx, custodialVtxosKeys, round.Txid); err != nil { + log.WithError(err).Warn("failed to mark custodial vtxos as spent") } go func() { - spentVtxos := append(s.getSpentVtxos(round.TxRequests), recoveredVtxos...) + spentVtxos := append(s.getSpentVtxos(round.TxRequests), custodialVtxos...) for i := range spentVtxos { spentVtxos[i].Spent = true spentVtxos[i].SpentBy = round.Txid diff --git a/server/internal/core/application/types.go b/server/internal/core/application/types.go index 7812c9a64..3f302ed0f 100644 --- a/server/internal/core/application/types.go +++ b/server/internal/core/application/types.go @@ -5,7 +5,6 @@ import ( "time" "github.com/ark-network/ark/common/bip322" - "github.com/ark-network/ark/common/note" "github.com/ark-network/ark/common/tree" "github.com/ark-network/ark/server/internal/core/domain" "github.com/ark-network/ark/server/internal/core/ports" @@ -15,7 +14,6 @@ import ( type Service interface { Start() error Stop() - SpendNotes(ctx context.Context, notes []note.Note) (string, error) RegisterIntent(ctx context.Context, bip322signature bip322.Signature, message tree.IntentMessage) (string, error) SpendVtxos(ctx context.Context, inputs []ports.Input) (string, error) ClaimVtxos(ctx context.Context, creds string, receivers []domain.Receiver, musig2Data *tree.Musig2) error @@ -135,7 +133,6 @@ type TxRequestInfo struct { } Inputs []domain.Vtxo BoardingInputs []ports.BoardingInput - Notes []note.Note SigningType string Cosigners []string LastPing time.Time diff --git a/server/internal/core/application/utils.go b/server/internal/core/application/utils.go index 1c46db624..5704cef95 100644 --- a/server/internal/core/application/utils.go +++ b/server/internal/core/application/utils.go @@ -8,7 +8,6 @@ import ( "time" "github.com/ark-network/ark/common" - "github.com/ark-network/ark/common/note" "github.com/ark-network/ark/common/tree" "github.com/ark-network/ark/server/internal/core/domain" "github.com/ark-network/ark/server/internal/core/ports" @@ -23,11 +22,10 @@ const ( type timedTxRequest struct { domain.TxRequest boardingInputs []ports.BoardingInput - notes []note.Note timestamp time.Time pingTimestamp time.Time musig2Data *tree.Musig2 - recoveredVtxos []domain.Vtxo + custodialVtxos []domain.Vtxo } type txRequestsQueue struct { @@ -54,32 +52,10 @@ func (m *txRequestsQueue) len() int64 { return count } -func (m *txRequestsQueue) pushWithNotes(request domain.TxRequest, notes []note.Note) error { - m.lock.Lock() - defer m.lock.Unlock() - - if _, ok := m.requests[request.Id]; ok { - return fmt.Errorf("duplicated tx request %s", request.Id) - } - - for _, note := range notes { - for _, txRequest := range m.requests { - for _, rNote := range txRequest.notes { - if note.ID == rNote.ID { - return fmt.Errorf("duplicated note %s", note) - } - } - } - } - - m.requests[request.Id] = &timedTxRequest{request, make([]ports.BoardingInput, 0), notes, time.Now(), time.Time{}, nil, make([]domain.Vtxo, 0)} - return nil -} - func (m *txRequestsQueue) push( request domain.TxRequest, boardingInputs []ports.BoardingInput, - recoveredVtxos []domain.Vtxo, + custodialVtxos []domain.Vtxo, musig2Data *tree.Musig2, ) error { m.lock.Lock() @@ -109,9 +85,9 @@ func (m *txRequestsQueue) push( } } - for _, vtxo := range recoveredVtxos { + for _, vtxo := range custodialVtxos { for _, request := range m.requests { - for _, pVtxo := range request.recoveredVtxos { + for _, pVtxo := range request.custodialVtxos { if vtxo.Txid == pVtxo.Txid && vtxo.VOut == pVtxo.VOut { return fmt.Errorf("duplicated vtxo recovery, %s:%d already used by tx request %s", vtxo.Txid, vtxo.VOut, request.Id) } @@ -120,11 +96,11 @@ func (m *txRequestsQueue) push( } now := time.Now() - m.requests[request.Id] = &timedTxRequest{request, boardingInputs, make([]note.Note, 0), now, now, musig2Data, recoveredVtxos} + m.requests[request.Id] = &timedTxRequest{request, boardingInputs, now, now, musig2Data, custodialVtxos} return nil } -func (m *txRequestsQueue) pop(num int64) ([]domain.TxRequest, []ports.BoardingInput, []note.Note, []*tree.Musig2, []domain.Vtxo) { +func (m *txRequestsQueue) pop(num int64) ([]domain.TxRequest, []ports.BoardingInput, []*tree.Musig2, []domain.Vtxo) { m.lock.Lock() defer m.lock.Unlock() @@ -161,18 +137,16 @@ func (m *txRequestsQueue) pop(num int64) ([]domain.TxRequest, []ports.BoardingIn requests := make([]domain.TxRequest, 0, num) boardingInputs := make([]ports.BoardingInput, 0) - notes := make([]note.Note, 0) musig2Data := make([]*tree.Musig2, 0) - recoveredVtxos := make([]domain.Vtxo, 0) + custodialVtxos := make([]domain.Vtxo, 0) for _, p := range requestsByTime[:num] { boardingInputs = append(boardingInputs, p.boardingInputs...) requests = append(requests, p.TxRequest) musig2Data = append(musig2Data, p.musig2Data) - notes = append(notes, p.notes...) - recoveredVtxos = append(recoveredVtxos, p.recoveredVtxos...) + custodialVtxos = append(custodialVtxos, p.custodialVtxos...) delete(m.requests, p.Id) } - return requests, boardingInputs, notes, musig2Data, recoveredVtxos + return requests, boardingInputs, musig2Data, custodialVtxos } func (m *txRequestsQueue) update(request domain.TxRequest, musig2Data *tree.Musig2) error { @@ -194,11 +168,7 @@ func (m *txRequestsQueue) update(request domain.TxRequest, musig2Data *tree.Musi sumOfInputs += boardingInput.Amount } - for _, note := range r.notes { - sumOfInputs += uint64(note.Value) - } - - for _, vtxo := range r.recoveredVtxos { + for _, vtxo := range r.custodialVtxos { sumOfInputs += vtxo.Amount } diff --git a/server/internal/core/domain/note_repo.go b/server/internal/core/domain/note_repo.go deleted file mode 100644 index 5f2d6ed6e..000000000 --- a/server/internal/core/domain/note_repo.go +++ /dev/null @@ -1,9 +0,0 @@ -package domain - -import "context" - -type NoteRepository interface { - Contains(ctx context.Context, id uint64) (bool, error) - Add(ctx context.Context, id uint64) error - Close() -} diff --git a/server/internal/core/ports/repo_manager.go b/server/internal/core/ports/repo_manager.go index 2994c53f9..d34012019 100644 --- a/server/internal/core/ports/repo_manager.go +++ b/server/internal/core/ports/repo_manager.go @@ -6,7 +6,6 @@ type RepoManager interface { Events() domain.RoundEventRepository Rounds() domain.RoundRepository Vtxos() domain.VtxoRepository - Notes() domain.NoteRepository MarketHourRepo() domain.MarketHourRepo RegisterEventsHandler(func(*domain.Round)) Close() diff --git a/server/internal/core/ports/wallet.go b/server/internal/core/ports/wallet.go index 6a8b881bb..b3676d9e0 100644 --- a/server/internal/core/ports/wallet.go +++ b/server/internal/core/ports/wallet.go @@ -42,8 +42,6 @@ type WalletService interface { LockConnectorUtxos(ctx context.Context, utxos []TxOutpoint) error GetDustAmount(ctx context.Context) (uint64, error) GetTransaction(ctx context.Context, txid string) (string, error) - SignMessage(ctx context.Context, message []byte) ([]byte, error) - VerifyMessageSignature(ctx context.Context, message, signature []byte) (bool, error) GetCurrentBlockTime(ctx context.Context) (*BlockTimestamp, error) Withdraw(ctx context.Context, address string, amount uint64) (string, error) Close() diff --git a/server/internal/infrastructure/db/badger/note_repo.go b/server/internal/infrastructure/db/badger/note_repo.go deleted file mode 100644 index a03272af9..000000000 --- a/server/internal/infrastructure/db/badger/note_repo.go +++ /dev/null @@ -1,93 +0,0 @@ -package badgerdb - -import ( - "context" - "errors" - "fmt" - "path/filepath" - "sync" - "time" - - "github.com/ark-network/ark/server/internal/core/domain" - "github.com/dgraph-io/badger/v4" - "github.com/timshannon/badgerhold/v4" -) - -const noteStoreDir = "notes" - -type noteRepository struct { - store *badgerhold.Store - lock *sync.Mutex -} - -type note struct { - ID uint64 -} - -func NewNoteRepository(config ...interface{}) (domain.NoteRepository, error) { - if len(config) != 2 { - return nil, fmt.Errorf("invalid config") - } - baseDir, ok := config[0].(string) - if !ok { - return nil, fmt.Errorf("invalid base directory") - } - - var logger badger.Logger - if config[1] != nil { - logger, ok = config[1].(badger.Logger) - if !ok { - return nil, fmt.Errorf("invalid logger") - } - } - - var dir string - if len(baseDir) > 0 { - dir = filepath.Join(baseDir, noteStoreDir) - } - store, err := createDB(dir, logger) - if err != nil { - return nil, fmt.Errorf("failed to open note store: %s", err) - } - lock := &sync.Mutex{} - repo := ¬eRepository{store, lock} - return repo, nil -} - -func (n *noteRepository) Close() { - // nolint:all - n.store.Close() -} - -func (n *noteRepository) Add(ctx context.Context, id uint64) error { - n.lock.Lock() - defer n.lock.Unlock() - - if err := n.store.Insert(id, note{ID: id}); err != nil { - if errors.Is(err, badger.ErrConflict) { - attempts := 1 - for errors.Is(err, badger.ErrConflict) && attempts <= maxRetries { - time.Sleep(100 * time.Millisecond) - err = n.store.Insert(id, note{ID: id}) - attempts++ - } - } - return err - } - return nil -} - -func (n *noteRepository) Contains(ctx context.Context, id uint64) (bool, error) { - n.lock.Lock() - defer n.lock.Unlock() - - var v note - err := n.store.Get(id, &v) - if err != nil { - if errors.Is(err, badgerhold.ErrNotFound) { - return false, nil - } - return false, err - } - return true, nil -} diff --git a/server/internal/infrastructure/db/service.go b/server/internal/infrastructure/db/service.go index cdf5944ff..597456270 100644 --- a/server/internal/infrastructure/db/service.go +++ b/server/internal/infrastructure/db/service.go @@ -31,10 +31,6 @@ var ( "badger": badgerdb.NewVtxoRepository, "sqlite": sqlitedb.NewVtxoRepository, } - noteStoreTypes = map[string]func(...interface{}) (domain.NoteRepository, error){ - "badger": badgerdb.NewNoteRepository, - "sqlite": sqlitedb.NewNoteRepository, - } marketHourStoreTypes = map[string]func(...interface{}) (domain.MarketHourRepo, error){ "badger": badgerdb.NewMarketHourRepository, "sqlite": sqlitedb.NewMarketHourRepository, @@ -57,7 +53,6 @@ type service struct { eventStore domain.RoundEventRepository roundStore domain.RoundRepository vtxoStore domain.VtxoRepository - noteStore domain.NoteRepository marketHourRepo domain.MarketHourRepo } @@ -74,10 +69,6 @@ func NewService(config ServiceConfig) (ports.RepoManager, error) { if !ok { return nil, fmt.Errorf("vtxo store type not supported") } - noteStoreFactory, ok := noteStoreTypes[config.DataStoreType] - if !ok { - return nil, fmt.Errorf("note store type not supported") - } marketHourStoreFactory, ok := marketHourStoreTypes[config.DataStoreType] if !ok { return nil, fmt.Errorf("invalid data store type: %s", config.DataStoreType) @@ -86,7 +77,6 @@ func NewService(config ServiceConfig) (ports.RepoManager, error) { var eventStore domain.RoundEventRepository var roundStore domain.RoundRepository var vtxoStore domain.VtxoRepository - var noteStore domain.NoteRepository var marketHourRepo domain.MarketHourRepo var err error @@ -110,10 +100,6 @@ func NewService(config ServiceConfig) (ports.RepoManager, error) { if err != nil { return nil, fmt.Errorf("failed to open vtxo store: %s", err) } - noteStore, err = noteStoreFactory(config.DataStoreConfig...) - if err != nil { - return nil, fmt.Errorf("failed to open note store: %s", err) - } marketHourRepo, err = marketHourStoreFactory(config.DataStoreConfig...) if err != nil { return nil, fmt.Errorf("failed to create market hour store: %w", err) @@ -161,11 +147,6 @@ func NewService(config ServiceConfig) (ports.RepoManager, error) { if err != nil { return nil, fmt.Errorf("failed to open vtxo store: %s", err) } - noteStore, err = noteStoreFactory(db) - if err != nil { - return nil, fmt.Errorf("failed to open note store: %s", err) - } - marketHourRepo, err = marketHourStoreFactory(db) if err != nil { return nil, fmt.Errorf("failed to create market hour store: %w", err) @@ -176,7 +157,6 @@ func NewService(config ServiceConfig) (ports.RepoManager, error) { eventStore: eventStore, roundStore: roundStore, vtxoStore: vtxoStore, - noteStore: noteStore, marketHourRepo: marketHourRepo, }, nil } @@ -197,10 +177,6 @@ func (s *service) Vtxos() domain.VtxoRepository { return s.vtxoStore } -func (s *service) Notes() domain.NoteRepository { - return s.noteStore -} - func (s *service) MarketHourRepo() domain.MarketHourRepo { return s.marketHourRepo } @@ -209,6 +185,5 @@ func (s *service) Close() { s.eventStore.Close() s.roundStore.Close() s.vtxoStore.Close() - s.noteStore.Close() s.marketHourRepo.Close() } diff --git a/server/internal/infrastructure/db/service_test.go b/server/internal/infrastructure/db/service_test.go index d6dec5f86..296f8b54b 100644 --- a/server/internal/infrastructure/db/service_test.go +++ b/server/internal/infrastructure/db/service_test.go @@ -164,7 +164,6 @@ func TestService(t *testing.T) { testRoundEventRepository(t, svc) testRoundRepository(t, svc) testVtxoRepository(t, svc) - testNoteRepository(t, svc) testMarketHourRepository(t, svc) }) } @@ -493,33 +492,6 @@ func testVtxoRepository(t *testing.T, svc ports.RepoManager) { }) } -func testNoteRepository(t *testing.T, svc ports.RepoManager) { - t.Run("test_note_repository", func(t *testing.T) { - ctx := context.Background() - - err := svc.Notes().Add(ctx, 1) - require.NoError(t, err) - - err = svc.Notes().Add(ctx, 1099200322) - require.NoError(t, err) - - contains, err := svc.Notes().Contains(ctx, 1) - require.NoError(t, err) - require.True(t, contains) - - contains, err = svc.Notes().Contains(ctx, 1099200322) - require.NoError(t, err) - require.True(t, contains) - - contains, err = svc.Notes().Contains(ctx, 456) - require.NoError(t, err) - require.False(t, contains) - - err = svc.Notes().Add(ctx, 1) - require.Error(t, err) - }) -} - func testMarketHourRepository(t *testing.T, svc ports.RepoManager) { t.Run("test_market_hour_repository", func(t *testing.T) { ctx := context.Background() diff --git a/server/internal/infrastructure/db/sqlite/migration/20250513103501_drop_note.down.sql b/server/internal/infrastructure/db/sqlite/migration/20250513103501_drop_note.down.sql new file mode 100644 index 000000000..d519d6e0d --- /dev/null +++ b/server/internal/infrastructure/db/sqlite/migration/20250513103501_drop_note.down.sql @@ -0,0 +1,3 @@ +CREATE TABLE IF NOT EXISTS note ( + id INTEGER PRIMARY KEY +); \ No newline at end of file diff --git a/server/internal/infrastructure/db/sqlite/migration/20250513103501_drop_note.up.sql b/server/internal/infrastructure/db/sqlite/migration/20250513103501_drop_note.up.sql new file mode 100644 index 000000000..a1eed3d3c --- /dev/null +++ b/server/internal/infrastructure/db/sqlite/migration/20250513103501_drop_note.up.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS note; \ No newline at end of file diff --git a/server/internal/infrastructure/db/sqlite/note_repo.go b/server/internal/infrastructure/db/sqlite/note_repo.go deleted file mode 100644 index 3cfdb3bd6..000000000 --- a/server/internal/infrastructure/db/sqlite/note_repo.go +++ /dev/null @@ -1,58 +0,0 @@ -package sqlitedb - -import ( - "context" - "database/sql" - "fmt" - "time" - - "github.com/ark-network/ark/server/internal/core/domain" - "github.com/ark-network/ark/server/internal/infrastructure/db/sqlite/sqlc/queries" -) - -type noteRepository struct { - db *sql.DB - querier *queries.Queries -} - -func NewNoteRepository(config ...interface{}) (domain.NoteRepository, error) { - if len(config) != 1 { - return nil, fmt.Errorf("invalid config") - } - db, ok := config[0].(*sql.DB) - if !ok { - return nil, fmt.Errorf("cannot open note repository: invalid config, expected db at 0") - } - - return ¬eRepository{ - db: db, - querier: queries.New(db), - }, nil -} - -func (n *noteRepository) Close() { - _ = n.db.Close() -} - -func (n *noteRepository) Add(ctx context.Context, id uint64) error { - if err := n.querier.InsertNote(ctx, int64(id)); err != nil { - if isConflictError(err) { - attempts := 1 - for isConflictError(err) && attempts <= maxRetries { - time.Sleep(100 * time.Millisecond) - err = n.querier.InsertNote(ctx, int64(id)) - attempts++ - } - } - return err - } - return nil -} - -func (n *noteRepository) Contains(ctx context.Context, id uint64) (bool, error) { - contains, err := n.querier.ContainsNote(ctx, int64(id)) - if err != nil { - return false, err - } - return contains == 1, nil -} diff --git a/server/internal/interface/grpc/handlers/arkservice.go b/server/internal/interface/grpc/handlers/arkservice.go index f73229587..7f93df475 100644 --- a/server/internal/interface/grpc/handlers/arkservice.go +++ b/server/internal/interface/grpc/handlers/arkservice.go @@ -138,49 +138,29 @@ func (h *handler) GetBoardingAddress( func (h *handler) RegisterIntent( ctx context.Context, req *arkv1.RegisterIntentRequest, ) (*arkv1.RegisterIntentResponse, error) { - notesInputs := req.GetNotes() bip322Signature := req.GetBip322Signature() - if len(notesInputs) <= 0 && bip322Signature == nil { + if bip322Signature == nil { return nil, status.Error(codes.InvalidArgument, "missing inputs") } - if bip322Signature != nil && len(notesInputs) > 0 { - return nil, status.Error(codes.InvalidArgument, "cannot mix vtxos and notes") + signature, err := bip322.DecodeSignature(bip322Signature.Signature) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid BIP0322 signature") } - requestID := "" - - if bip322Signature != nil { - signature, err := bip322.DecodeSignature(bip322Signature.Signature) - if err != nil { - return nil, status.Error(codes.InvalidArgument, "invalid BIP0322 signature") - } - - if len(bip322Signature.Message) <= 0 { - return nil, status.Error(codes.InvalidArgument, "missing message") - } - - var message tree.IntentMessage - if err := message.Decode(bip322Signature.Message); err != nil { - return nil, status.Error(codes.InvalidArgument, "invalid BIP0322 message") - } + if len(bip322Signature.Message) <= 0 { + return nil, status.Error(codes.InvalidArgument, "missing message") + } - requestID, err = h.svc.RegisterIntent(ctx, *signature, message) - if err != nil { - return nil, err - } + var message tree.IntentMessage + if err := message.Decode(bip322Signature.Message); err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid BIP0322 message") } - if len(notesInputs) > 0 { - notes, err := parseNotes(notesInputs) - if err != nil { - return nil, status.Error(codes.InvalidArgument, err.Error()) - } - requestID, err = h.svc.SpendNotes(ctx, notes) - if err != nil { - return nil, err - } + requestID, err := h.svc.RegisterIntent(ctx, *signature, message) + if err != nil { + return nil, err } return &arkv1.RegisterIntentResponse{ @@ -192,38 +172,18 @@ func (h *handler) RegisterInputsForNextRound( ctx context.Context, req *arkv1.RegisterInputsForNextRoundRequest, ) (*arkv1.RegisterInputsForNextRoundResponse, error) { vtxosInputs := req.GetInputs() - notesInputs := req.GetNotes() - if len(vtxosInputs) <= 0 && len(notesInputs) <= 0 { + if len(vtxosInputs) <= 0 { return nil, status.Error(codes.InvalidArgument, "missing inputs") } - if len(vtxosInputs) > 0 && len(notesInputs) > 0 { - return nil, status.Error(codes.InvalidArgument, "cannot mix vtxos and notes") - } - - requestID := "" - - if len(vtxosInputs) > 0 { - inputs, err := parseInputs(vtxosInputs) - if err != nil { - return nil, status.Error(codes.InvalidArgument, err.Error()) - } - requestID, err = h.svc.SpendVtxos(ctx, inputs) - if err != nil { - return nil, err - } + inputs, err := parseInputs(vtxosInputs) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) } - - if len(notesInputs) > 0 { - notes, err := parseNotes(notesInputs) - if err != nil { - return nil, status.Error(codes.InvalidArgument, err.Error()) - } - requestID, err = h.svc.SpendNotes(ctx, notes) - if err != nil { - return nil, err - } + requestID, err := h.svc.SpendVtxos(ctx, inputs) + if err != nil { + return nil, err } return &arkv1.RegisterInputsForNextRoundResponse{ diff --git a/server/internal/interface/grpc/handlers/parser.go b/server/internal/interface/grpc/handlers/parser.go index 9c1311626..d26708d8a 100644 --- a/server/internal/interface/grpc/handlers/parser.go +++ b/server/internal/interface/grpc/handlers/parser.go @@ -6,7 +6,6 @@ import ( arkv1 "github.com/ark-network/ark/api-spec/protobuf/gen/ark/v1" "github.com/ark-network/ark/common" - "github.com/ark-network/ark/common/note" "github.com/ark-network/ark/common/tree" "github.com/ark-network/ark/server/internal/core/application" "github.com/ark-network/ark/server/internal/core/domain" @@ -35,24 +34,6 @@ func parseArkAddress(addr string) (string, error) { return hex.EncodeToString(schnorr.SerializePubKey(a.VtxoTapKey)), nil } -func parseNotes(notes []string) ([]note.Note, error) { - if len(notes) <= 0 { - return nil, fmt.Errorf("missing notes") - } - - notesParsed := make([]note.Note, 0, len(notes)) - for _, noteStr := range notes { - n, err := note.NewFromString(noteStr) - if err != nil { - return nil, fmt.Errorf("invalid note: %s", err) - } - - notesParsed = append(notesParsed, *n) - } - - return notesParsed, nil -} - func parseInputs(ins []*arkv1.Input) ([]ports.Input, error) { if len(ins) <= 0 { return nil, fmt.Errorf("missing inputs") @@ -270,18 +251,12 @@ func (i txReqsInfo) toProto() []*arkv1.TxRequestInfo { }) } - notes := make([]string, 0, len(req.Notes)) - for _, note := range req.Notes { - notes = append(notes, note.String()) - } - list = append(list, &arkv1.TxRequestInfo{ Id: req.Id, CreatedAt: req.CreatedAt.Unix(), Receivers: receivers, Inputs: inputs, BoardingInputs: boardingInputs, - Notes: notes, SigningType: req.SigningType, CosignersPublicKeys: req.Cosigners, LastPing: req.LastPing.Unix(), From a2d65480d096c2cd53670218617985f5f2eb425f Mon Sep 17 00:00:00 2001 From: louisinger Date: Wed, 14 May 2025 09:19:55 +0200 Subject: [PATCH 2/4] preimage : use fixed length array --- common/note/note.go | 16 +++++++++------- common/note/note_test.go | 37 ++++++++++++++++--------------------- pkg/client-sdk/client.go | 2 +- 3 files changed, 26 insertions(+), 29 deletions(-) diff --git a/common/note/note.go b/common/note/note.go index adbce2470..360bfbff8 100644 --- a/common/note/note.go +++ b/common/note/note.go @@ -24,7 +24,7 @@ const ( // Note contains the data of a note type Note struct { - Preimage []byte + Preimage [preimageSize]byte Value uint32 } @@ -35,9 +35,11 @@ func New(value uint32) (*Note, error) { if err != nil { return nil, fmt.Errorf("failed to generate random preimage: %w", err) } + var preimageArray [preimageSize]byte + copy(preimageArray[:], randomPreimage) return &Note{ - Preimage: randomPreimage, + Preimage: preimageArray, Value: value, }, nil } @@ -66,7 +68,7 @@ func NewFromString(s string) (*Note, error) { // Serialize converts Note's data to a byte slice func (n *Note) Serialize() []byte { buf := make([]byte, preimageSize+4) - copy(buf[:preimageSize], n.Preimage) + copy(buf[:preimageSize], n.Preimage[:]) binary.BigEndian.PutUint32(buf[preimageSize:], n.Value) return buf } @@ -77,7 +79,7 @@ func (n *Note) Deserialize(data []byte) error { return fmt.Errorf("invalid data length: expected %d bytes, got %d", preimageSize+4, len(data)) } - n.Preimage = data[:preimageSize] + copy(n.Preimage[:], data[:preimageSize]) n.Value = binary.BigEndian.Uint32(data[preimageSize:]) return nil } @@ -87,8 +89,8 @@ func (n Note) String() string { return noteHRP + base58.Encode(n.Serialize()) } -func (n Note) PreimageHash() [32]byte { - return sha256.Sum256(n.Preimage) +func (n Note) PreimageHash() [preimageSize]byte { + return sha256.Sum256(n.Preimage[:]) } func (n Note) VtxoScript() tree.TapscriptsVtxoScript { @@ -129,7 +131,7 @@ func (n Note) BIP322Input() (*bip322.Input, error) { // implements tree.Closure interface, // can't be used in a classic vtxo script but only in the fake vtxo note script type NoteClosure struct { - PreimageHash [32]byte + PreimageHash [preimageSize]byte } // Script returns the tapscript for the note closure diff --git a/common/note/note_test.go b/common/note/note_test.go index fba16c048..689b12a87 100644 --- a/common/note/note_test.go +++ b/common/note/note_test.go @@ -53,8 +53,8 @@ func TestNew(t *testing.T) { for i := 0; i < 1_000_000; i++ { data, err := note.New(100) require.NoError(t, err) - require.False(t, preimageSet[hex.EncodeToString(data.Preimage)], "Generated duplicate preimage: %x", data.Preimage) - preimageSet[hex.EncodeToString(data.Preimage)] = true + require.False(t, preimageSet[hex.EncodeToString(data.Preimage[:])], "Generated duplicate preimage: %x", data.Preimage) + preimageSet[hex.EncodeToString(data.Preimage[:])] = true } }) } @@ -62,35 +62,30 @@ func TestNew(t *testing.T) { func TestNewFromString(t *testing.T) { tests := []struct { str string - expectedPreimage []byte + expectedPreimage string expectedValue uint32 }{ { - str: "arknote8rFzGqZsG9RCLripA6ez8d2hQEzFKsqCeiSnXhQj56Ysw7ZQT", - expectedPreimage: []byte{ - 0x11, 0xd2, 0xa0, 0x32, 0x64, 0xd0, 0xef, 0xd3, - 0x11, 0xd2, 0xa0, 0x32, 0x64, 0xd0, 0xef, 0xd3, - 0x11, 0xd2, 0xa0, 0x32, 0x64, 0xd0, 0xef, 0xd3, - 0x11, 0xd2, 0xa0, 0x32, 0x64, 0xd0, 0xef, 0xd3, - }, - expectedValue: 900000, + str: "arknote8rFzGqZsG9RCLripA6ez8d2hQEzFKsqCeiSnXhQj56Ysw7ZQT", + expectedPreimage: "11d2a03264d0efd311d2a03264d0efd311d2a03264d0efd311d2a03264d0efd3", + expectedValue: 900000, }, { - str: "arknoteSkB92YpWm4Q2ijQHH34cqbKkCZWszsiQgHVjtNeFF2Cwp59D", - expectedPreimage: []byte{ - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, - 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, - 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, - }, - expectedValue: 1828932, + str: "arknoteSkB92YpWm4Q2ijQHH34cqbKkCZWszsiQgHVjtNeFF2Cwp59D", + expectedPreimage: "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + expectedValue: 1828932, }, } for _, tt := range tests { t.Run(tt.str, func(t *testing.T) { + preimage, err := hex.DecodeString(tt.expectedPreimage) + require.NoError(t, err) + var preimageArray [32]byte + copy(preimageArray[:], preimage) + n := ¬e.Note{ - Preimage: tt.expectedPreimage, + Preimage: preimageArray, Value: tt.expectedValue, } @@ -100,7 +95,7 @@ func TestNewFromString(t *testing.T) { note, err := note.NewFromString(tt.str) require.NoError(t, err) require.NotNil(t, note) - require.Equal(t, tt.expectedPreimage, note.Preimage) + require.Equal(t, preimageArray, note.Preimage) require.Equal(t, tt.expectedValue, note.Value) }) } diff --git a/pkg/client-sdk/client.go b/pkg/client-sdk/client.go index e2f9a9048..84313748a 100644 --- a/pkg/client-sdk/client.go +++ b/pkg/client-sdk/client.go @@ -3526,7 +3526,7 @@ func toBIP322Inputs( } witness, err := vtxoScript.Closures[0].Witness(leafProof.ControlBlock, map[string][]byte{ - "preimage": parsedNote.Preimage, + "preimage": parsedNote.Preimage[:], }) if err != nil { return nil, nil, nil, nil, fmt.Errorf("failed to get witness: %s", err) From 8ab50051dc97b8fd67c7bd710ccbbc2f773e8e04 Mon Sep 17 00:00:00 2001 From: louisinger Date: Wed, 14 May 2025 09:20:51 +0200 Subject: [PATCH 3/4] NoteClosure.WitnessSize : use preimageSize constant --- common/note/note.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/note/note.go b/common/note/note.go index 360bfbff8..e816d381d 100644 --- a/common/note/note.go +++ b/common/note/note.go @@ -177,7 +177,7 @@ func (n *NoteClosure) Decode(script []byte) (bool, error) { // WitnessSize returns the size of the witness data excluding the control block and script func (n *NoteClosure) WitnessSize(_ ...int) int { - return 32 // preimage is always 32 bytes + return preimageSize } // Witness returns the witness stack for spending the fake vtxo note From 49cbc41f6fe2a02cbd5745946987fcc8c8bde357 Mon Sep 17 00:00:00 2001 From: louisinger Date: Wed, 14 May 2025 16:40:25 +0200 Subject: [PATCH 4/4] interface : use getters --- server/internal/interface/grpc/handlers/arkservice.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/internal/interface/grpc/handlers/arkservice.go b/server/internal/interface/grpc/handlers/arkservice.go index 7f93df475..7c56401b0 100644 --- a/server/internal/interface/grpc/handlers/arkservice.go +++ b/server/internal/interface/grpc/handlers/arkservice.go @@ -144,17 +144,19 @@ func (h *handler) RegisterIntent( return nil, status.Error(codes.InvalidArgument, "missing inputs") } - signature, err := bip322.DecodeSignature(bip322Signature.Signature) + signature, err := bip322.DecodeSignature(bip322Signature.GetSignature()) if err != nil { return nil, status.Error(codes.InvalidArgument, "invalid BIP0322 signature") } - if len(bip322Signature.Message) <= 0 { + intentMessage := bip322Signature.GetMessage() + + if len(intentMessage) <= 0 { return nil, status.Error(codes.InvalidArgument, "missing message") } var message tree.IntentMessage - if err := message.Decode(bip322Signature.Message); err != nil { + if err := message.Decode(intentMessage); err != nil { return nil, status.Error(codes.InvalidArgument, "invalid BIP0322 message") }