From 347f88d55df4d4e0167ad4e005721b638991ecef Mon Sep 17 00:00:00 2001 From: Benjamin Bengfort Date: Tue, 15 Mar 2022 18:28:58 -0500 Subject: [PATCH] [WIP] Protocol changes from the v9 Whitepaper (#83) * Protocol changes from the v9 Whitepaper * generate reference library structures --- pkg/trisa/api/v1beta1/api.pb.go | 281 ++++++++++++------ .../data/generic/v1beta1/transaction.pb.go | 220 ++++++++++++-- proto/trisa/api/v1beta1/api.proto | 85 ++++-- .../data/generic/v1beta1/transaction.proto | 24 +- 4 files changed, 458 insertions(+), 152 deletions(-) diff --git a/pkg/trisa/api/v1beta1/api.pb.go b/pkg/trisa/api/v1beta1/api.pb.go index 62fe6c3..be7421a 100644 --- a/pkg/trisa/api/v1beta1/api.pb.go +++ b/pkg/trisa/api/v1beta1/api.pb.go @@ -89,27 +89,56 @@ type SecureEnvelope struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The transaction identifier generated by the sender. Any response - // to a transaction request needs to carry the same identifier. + // The transaction identifier generated by the sender. Any message concerning the + // same blockhain transaction requires the same envelope ID on both sending and + // responding RPCs. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Encrypted Payload + // Encrypted payload that contains the IVMS 101 IdentityPayload for compliance and + // a generic transaction payload that is used to identify the transaction on the + // blockchain or perform flow control messages in TRISA itself. This payload should + // be encrypted using the encryption algorithm and key defined below. Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` - // Encryption key used to encrypt the transaction blob. This key itself - // is encrypted using the public key of the receiver. + // Encryption key used to encrypt the compliance payload, usually generated on a + // per-envelope basis. To seal the envelope, this key should be encrypted with the + // public key of the recipient. If this key is in the clear, the sealed flag should + // be false. EncryptionKey []byte `protobuf:"bytes,3,opt,name=encryption_key,json=encryptionKey,proto3" json:"encryption_key,omitempty"` - // The encryption algorithm used to encrypt the transaction blob. + // The encryption algorithm used to encrypt the compliance payload. This string + // should provide enough information for the recipient to understand how to decrypt + // the payload including algorithm, variants, block length, etc. EncryptionAlgorithm string `protobuf:"bytes,4,opt,name=encryption_algorithm,json=encryptionAlgorithm,proto3" json:"encryption_algorithm,omitempty"` - // HMAC signature calculated from encrypted transaction blob. + // HMAC signature calculated from encrypted encrypted compliance payload using the + // hmac algorithm and secret defined below. This signature provides non-repudiation + // to regulators and counterparties that ensure the envelope has not been tampered + // with after receipt, particularly when comparing two envelopes. Hmac []byte `protobuf:"bytes,5,opt,name=hmac,proto3" json:"hmac,omitempty"` - // The HMAC secret used to calculate the HMAC signature. This secret - // itself is encrypted using the public key of the receiver. + // The HMAC secret used to calculate the HMAC signature. To seal the envelope, this + // secret should be encrypted with the public key of the recipient. If this secret + // is in the clear, the sealed flag should be false. HmacSecret []byte `protobuf:"bytes,6,opt,name=hmac_secret,json=hmacSecret,proto3" json:"hmac_secret,omitempty"` - // The algorithm used to calculate the HMAC signature. + // The algorithm used to calculate the HMAC signature. This string should provide + // enough information for the recipient to understand how to compute the HMAC + // including algorithm, block length, hashing function, etc. HmacAlgorithm string `protobuf:"bytes,7,opt,name=hmac_algorithm,json=hmacAlgorithm,proto3" json:"hmac_algorithm,omitempty"` - // Rejection errors are used inside of a streaming context so that the stream is - // not closed when an exchange-related rejection occurs. In the unary case, errors - // are directly returned rather than as part of the secure envelope. + // Rejection/TRISA errors should be specified in the SecureEnvelope for correct + // compliance processing and not returned as a gRPC error. E.g. if the counterparty + // wishes to send a TRISA error, they should send an OK gRPC response with the error + // in this field. Networking errors such as unavailable, mTLS failure, or timeouts + // are handled separately from compliance-related errors. Error *Error `protobuf:"bytes,9,opt,name=error,proto3" json:"error,omitempty"` + // The RFC-3339 formatted timestamp at nanosecond resolution. Used to order + // SecureEnvelopes related to the same transaction. While this timestamp is likely + // the same as the sent_at timestamp in the compliance payload, it does not serve + // the same purpose. The compliance payload timestamps are for non-repudiation, + // whereas this timestamp is for envelope and communication management. + Timestamp string `protobuf:"bytes,10,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Metadata related to the public key cryptography that seal the envelope by + // encrypting the encryption key and hmac secret such that only the recipient can + // fully decrypt the envelope. If the envelope is sealed, it indicates that the + // encryption key and hmac secret are encrypted with a public key, whose signature + // can be used for the recipient to identify the key pair required for decryption. + Sealed bool `protobuf:"varint,11,opt,name=sealed,proto3" json:"sealed,omitempty"` + PublicKeySignature string `protobuf:"bytes,12,opt,name=public_key_signature,json=publicKeySignature,proto3" json:"public_key_signature,omitempty"` } func (x *SecureEnvelope) Reset() { @@ -200,16 +229,40 @@ func (x *SecureEnvelope) GetError() *Error { return nil } -// Payload is the expected message structure that will be parsed from the encrypted -// secure envelope. The Payload should contain the identity and transaction information -// for the information exchange. The internal message types are purposefully generic to -// allow flexibility with the data needs for different exchanges. +func (x *SecureEnvelope) GetTimestamp() string { + if x != nil { + return x.Timestamp + } + return "" +} + +func (x *SecureEnvelope) GetSealed() bool { + if x != nil { + return x.Sealed + } + return false +} + +func (x *SecureEnvelope) GetPublicKeySignature() string { + if x != nil { + return x.PublicKeySignature + } + return "" +} + +// Payload contains the compliance identity information that must be exchanged in a +// secure fashion, transaction information for both counterparties to uniquely identify +// the transaction on the chain, and timestamps that are used for regulatory +// non-repudiation. This payload is serialized and encrypted to be sent in the +// SecureEnvelope as well as digitally signed to ensure that the payload has not been +// tampered with after transmission. The internal message types of the payload are +// purposefully generic to allow flexibility with the data needs for different exchanges. type Payload struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Identity contains any valid identity structure. The recommended format is the + // Identity contains any valid identity structure. The expected format is the // IVMS101 IdentityPayload which contains the originator and beneficiary identities, // the originator and beneficiary VASP identities, as well as the transfer path of // any intermediate VASPs. The identity payload can be bidirectional (containing @@ -219,7 +272,16 @@ type Payload struct { // unidirectional case, the identities must be collated after. Identity *anypb.Any `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` // Transaction contains network specific information about the exchange or transfer. + // It can also contain transfer control messages such as Pending messages to + // facilitate multi-message compliance exchanges. These messages must all be + // digtially signed for auditing purposes. Transaction *anypb.Any `protobuf:"bytes,2,opt,name=transaction,proto3" json:"transaction,omitempty"` + // Timestamps the describe when the payload was originally sent and when it was + // accepted or received by the counterparty. These timestamps must be in the payload + // so that they are digitally signed for non-repudiation. Both timestamps should be + // RFC-3339 formatted strings with timezone information. + SentAt string `protobuf:"bytes,3,opt,name=sent_at,json=sentAt,proto3" json:"sent_at,omitempty"` + ReceivedAt string `protobuf:"bytes,4,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"` } func (x *Payload) Reset() { @@ -268,6 +330,20 @@ func (x *Payload) GetTransaction() *anypb.Any { return nil } +func (x *Payload) GetSentAt() string { + if x != nil { + return x.SentAt + } + return "" +} + +func (x *Payload) GetReceivedAt() string { + if x != nil { + return x.ReceivedAt + } + return "" +} + // TODO: specify the address confirmation protocol. type Address struct { state protoimpl.MessageState @@ -588,7 +664,7 @@ var file_trisa_api_v1beta1_api_proto_rawDesc = []byte{ 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa0, 0x02, 0x0a, 0x0e, + 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x88, 0x03, 0x0a, 0x0e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, @@ -606,86 +682,97 @@ var file_trisa_api_v1beta1_api_proto_rawDesc = []byte{ 0x0d, 0x68, 0x6d, 0x61, 0x63, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x2e, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x73, - 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x69, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, - 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x36, 0x0a, 0x0b, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x09, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x15, - 0x0a, 0x13, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x91, 0x02, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, - 0x67, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2f, 0x0a, 0x13, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x30, 0x0a, - 0x14, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x61, 0x6c, 0x67, 0x6f, - 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, - 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x74, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x1b, - 0x0a, 0x09, 0x6e, 0x6f, 0x74, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x74, 0x41, 0x66, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x72, - 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, - 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x51, 0x0a, 0x0b, 0x48, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x74, 0x74, 0x65, - 0x6d, 0x70, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x61, 0x74, 0x74, 0x65, - 0x6d, 0x70, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6c, - 0x61, 0x73, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x74, 0x22, 0xe7, 0x01, 0x0a, - 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3e, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, - 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, - 0x0a, 0x6e, 0x6f, 0x74, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x1b, 0x0a, 0x09, - 0x6e, 0x6f, 0x74, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x6e, 0x6f, 0x74, 0x41, 0x66, 0x74, 0x65, 0x72, 0x22, 0x5b, 0x0a, 0x06, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, - 0x12, 0x0b, 0x0a, 0x07, 0x48, 0x45, 0x41, 0x4c, 0x54, 0x48, 0x59, 0x10, 0x01, 0x12, 0x0d, 0x0a, - 0x09, 0x55, 0x4e, 0x48, 0x45, 0x41, 0x4c, 0x54, 0x48, 0x59, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, - 0x44, 0x41, 0x4e, 0x47, 0x45, 0x52, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x46, 0x46, 0x4c, - 0x49, 0x4e, 0x45, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, - 0x41, 0x4e, 0x43, 0x45, 0x10, 0x05, 0x32, 0xe7, 0x02, 0x0a, 0x0c, 0x54, 0x52, 0x49, 0x53, 0x41, - 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x52, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x66, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x45, 0x6e, - 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, + 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x65, 0x61, 0x6c, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x65, + 0x61, 0x6c, 0x65, 0x64, 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, + 0x65, 0x79, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x12, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xad, 0x01, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x12, 0x30, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x12, 0x36, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, + 0x73, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x65, 0x6e, 0x74, 0x41, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, + 0x69, 0x76, 0x65, 0x64, 0x41, 0x74, 0x22, 0x09, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x22, 0x15, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x91, 0x02, 0x0a, 0x0a, 0x53, 0x69, 0x67, + 0x6e, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, + 0x2f, 0x0a, 0x13, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x61, 0x6c, 0x67, + 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, + 0x12, 0x30, 0x0a, 0x14, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x61, + 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, + 0x68, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x74, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x74, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x74, 0x41, 0x66, 0x74, 0x65, 0x72, 0x12, 0x18, + 0x0a, 0x07, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x07, 0x72, 0x65, 0x76, 0x6f, 0x6b, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x51, 0x0a, 0x0b, + 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x08, 0x61, + 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x61, + 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x74, 0x22, + 0xe7, 0x01, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x26, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x74, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x74, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x74, 0x41, 0x66, 0x74, 0x65, 0x72, 0x22, 0x5b, 0x0a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x48, 0x45, 0x41, 0x4c, 0x54, 0x48, 0x59, 0x10, 0x01, + 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x48, 0x45, 0x41, 0x4c, 0x54, 0x48, 0x59, 0x10, 0x02, 0x12, + 0x0a, 0x0a, 0x06, 0x44, 0x41, 0x4e, 0x47, 0x45, 0x52, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x4f, + 0x46, 0x46, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x41, 0x49, 0x4e, + 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x05, 0x32, 0xe7, 0x02, 0x0a, 0x0c, 0x54, 0x52, + 0x49, 0x53, 0x41, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x52, 0x0a, 0x08, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x0e, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x21, 0x2e, - 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, - 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, - 0x6f, 0x70, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x72, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x2e, 0x74, 0x72, - 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x26, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0x00, 0x12, 0x4d, 0x0a, 0x0b, 0x4b, 0x65, 0x79, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x1d, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x1a, - 0x1d, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x22, 0x00, - 0x32, 0x5a, 0x0a, 0x0b, 0x54, 0x52, 0x49, 0x53, 0x41, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, - 0x4b, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x2e, 0x74, 0x72, 0x69, 0x73, - 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x65, - 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x1a, 0x1f, 0x2e, 0x74, 0x72, 0x69, 0x73, + 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0x00, 0x42, 0x38, 0x5a, 0x36, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x72, 0x69, 0x73, 0x61, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x75, 0x72, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x22, 0x00, 0x12, 0x5c, + 0x0a, 0x0e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x12, 0x21, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, + 0x6f, 0x70, 0x65, 0x1a, 0x21, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x45, 0x6e, + 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x56, 0x0a, 0x0e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, + 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x26, 0x2e, 0x74, 0x72, 0x69, + 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0b, 0x4b, 0x65, 0x79, 0x45, 0x78, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x12, 0x1d, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x4b, + 0x65, 0x79, 0x1a, 0x1d, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x4b, 0x65, + 0x79, 0x22, 0x00, 0x32, 0x5a, 0x0a, 0x0b, 0x54, 0x52, 0x49, 0x53, 0x41, 0x48, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x12, 0x4b, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x2e, 0x74, + 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x1a, 0x1f, 0x2e, 0x74, + 0x72, 0x69, 0x73, 0x61, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0x00, 0x42, + 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x72, + 0x69, 0x73, 0x61, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/pkg/trisa/data/generic/v1beta1/transaction.pb.go b/pkg/trisa/data/generic/v1beta1/transaction.pb.go index 2ac185b..795fd2b 100644 --- a/pkg/trisa/data/generic/v1beta1/transaction.pb.go +++ b/pkg/trisa/data/generic/v1beta1/transaction.pb.go @@ -37,6 +37,7 @@ type Transaction struct { Timestamp string `protobuf:"bytes,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // RFC 3339 timestamp of the transaction ExtraJson string `protobuf:"bytes,7,opt,name=extra_json,json=extraJson,proto3" json:"extra_json,omitempty"` // any extra data as a JSON formatted object AssetType string `protobuf:"bytes,8,opt,name=asset_type,json=assetType,proto3" json:"asset_type,omitempty"` // the type of virtual asset for mult-asset chains + Tag string `protobuf:"bytes,9,opt,name=tag,proto3" json:"tag,omitempty"` // optional memo/destination-tag required by some ledgers to identify transactions } func (x *Transaction) Reset() { @@ -127,9 +128,126 @@ func (x *Transaction) GetAssetType() string { return "" } -// A confirmation receipt is a generic reply to a TRISA transfer that may not have a -// beneficiary response, e.g. in the case where the originator collects all the KYC -// information. This is a convienience message for sending generic responses. +func (x *Transaction) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +// A control flow message to support asynchronous TRISA transfers. Pending messages can +// be returned as an intermediate response during a compliance transfer if further +// processing is required before a response can be sent. The Pending message should +// provide information to the originator about when they can expect a response via the +// reply_not_before and reply_not_after timestamps. The Pending message should also +// provide collation information such as the envelope_id and original transaction so +// that the response message can be matched to the original request. +type Pending struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EnvelopeId string `protobuf:"bytes,1,opt,name=envelope_id,json=envelopeId,proto3" json:"envelope_id,omitempty"` // the TRISA envelope ID that refers to the compliance communication + ReceivedBy string `protobuf:"bytes,2,opt,name=received_by,json=receivedBy,proto3" json:"received_by,omitempty"` // the name of the recipient or recipient VASP + ReceivedAt string `protobuf:"bytes,3,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"` // the RFC3339 formatted timestamp when the request was received + Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` // an optional message to respond with to the counterparty + ReplyNotAfter string `protobuf:"bytes,5,opt,name=reply_not_after,json=replyNotAfter,proto3" json:"reply_not_after,omitempty"` // the RFC3339 formatted timestamp when the response will be returned by + ReplyNotBefore string `protobuf:"bytes,6,opt,name=reply_not_before,json=replyNotBefore,proto3" json:"reply_not_before,omitempty"` // the RFC339 formatted timestamp that the response will not be sent before + ExtraJson string `protobuf:"bytes,7,opt,name=extra_json,json=extraJson,proto3" json:"extra_json,omitempty"` // any extra data as a JSON formatted object + Transaction *Transaction `protobuf:"bytes,15,opt,name=transaction,proto3" json:"transaction,omitempty"` // the original transaction for reference +} + +func (x *Pending) Reset() { + *x = Pending{} + if protoimpl.UnsafeEnabled { + mi := &file_trisa_data_generic_v1beta1_transaction_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pending) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pending) ProtoMessage() {} + +func (x *Pending) ProtoReflect() protoreflect.Message { + mi := &file_trisa_data_generic_v1beta1_transaction_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Pending.ProtoReflect.Descriptor instead. +func (*Pending) Descriptor() ([]byte, []int) { + return file_trisa_data_generic_v1beta1_transaction_proto_rawDescGZIP(), []int{1} +} + +func (x *Pending) GetEnvelopeId() string { + if x != nil { + return x.EnvelopeId + } + return "" +} + +func (x *Pending) GetReceivedBy() string { + if x != nil { + return x.ReceivedBy + } + return "" +} + +func (x *Pending) GetReceivedAt() string { + if x != nil { + return x.ReceivedAt + } + return "" +} + +func (x *Pending) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *Pending) GetReplyNotAfter() string { + if x != nil { + return x.ReplyNotAfter + } + return "" +} + +func (x *Pending) GetReplyNotBefore() string { + if x != nil { + return x.ReplyNotBefore + } + return "" +} + +func (x *Pending) GetExtraJson() string { + if x != nil { + return x.ExtraJson + } + return "" +} + +func (x *Pending) GetTransaction() *Transaction { + if x != nil { + return x.Transaction + } + return nil +} + +// DEPRECATED: the ConfirmationReceipt message was deemed to cause confusion as it could +// signal that the confirmation payload was received and the transfer is concluded. Use +// the Pending message instead to signal that this is a control flow message. type ConfirmationReceipt struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -145,7 +263,7 @@ type ConfirmationReceipt struct { func (x *ConfirmationReceipt) Reset() { *x = ConfirmationReceipt{} if protoimpl.UnsafeEnabled { - mi := &file_trisa_data_generic_v1beta1_transaction_proto_msgTypes[1] + mi := &file_trisa_data_generic_v1beta1_transaction_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -158,7 +276,7 @@ func (x *ConfirmationReceipt) String() string { func (*ConfirmationReceipt) ProtoMessage() {} func (x *ConfirmationReceipt) ProtoReflect() protoreflect.Message { - mi := &file_trisa_data_generic_v1beta1_transaction_proto_msgTypes[1] + mi := &file_trisa_data_generic_v1beta1_transaction_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -171,7 +289,7 @@ func (x *ConfirmationReceipt) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfirmationReceipt.ProtoReflect.Descriptor instead. func (*ConfirmationReceipt) Descriptor() ([]byte, []int) { - return file_trisa_data_generic_v1beta1_transaction_proto_rawDescGZIP(), []int{1} + return file_trisa_data_generic_v1beta1_transaction_proto_rawDescGZIP(), []int{2} } func (x *ConfirmationReceipt) GetEnvelopeId() string { @@ -216,7 +334,7 @@ var file_trisa_data_generic_v1beta1_transaction_proto_rawDesc = []byte{ 0x65, 0x72, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x69, 0x63, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x22, 0xf1, 0x01, 0x0a, 0x0b, 0x54, + 0x69, 0x63, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x22, 0x83, 0x02, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, @@ -231,24 +349,46 @@ var file_trisa_data_generic_v1beta1_transaction_proto_rawDesc = []byte{ 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0xbf, - 0x01, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, - 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x76, - 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, - 0x76, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, - 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, - 0x69, 0x76, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x41, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, - 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, - 0x72, 0x69, 0x73, 0x61, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2f, 0x74, 0x72, 0x69, 0x73, 0x61, - 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2f, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, + 0x22, 0xc2, 0x02, 0x0a, 0x07, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x1f, 0x0a, 0x0b, + 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, + 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x79, 0x12, 0x1f, + 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x72, 0x65, 0x70, + 0x6c, 0x79, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x6f, 0x74, 0x41, 0x66, 0x74, 0x65, + 0x72, 0x12, 0x28, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6c, 0x79, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x62, + 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, + 0x6c, 0x79, 0x4e, 0x6f, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, + 0x78, 0x74, 0x72, 0x61, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x0b, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x69, 0x63, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xbf, 0x01, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, + 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x1f, 0x0a, + 0x0b, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x79, 0x12, + 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x72, 0x69, 0x73, 0x61, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x2f, 0x74, 0x72, 0x69, 0x73, 0x61, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x74, 0x72, 0x69, 0x73, + 0x61, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x2f, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -263,17 +403,19 @@ func file_trisa_data_generic_v1beta1_transaction_proto_rawDescGZIP() []byte { return file_trisa_data_generic_v1beta1_transaction_proto_rawDescData } -var file_trisa_data_generic_v1beta1_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_trisa_data_generic_v1beta1_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_trisa_data_generic_v1beta1_transaction_proto_goTypes = []interface{}{ (*Transaction)(nil), // 0: trisa.data.generic.v1beta1.Transaction - (*ConfirmationReceipt)(nil), // 1: trisa.data.generic.v1beta1.ConfirmationReceipt + (*Pending)(nil), // 1: trisa.data.generic.v1beta1.Pending + (*ConfirmationReceipt)(nil), // 2: trisa.data.generic.v1beta1.ConfirmationReceipt } var file_trisa_data_generic_v1beta1_transaction_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 0, // 0: trisa.data.generic.v1beta1.Pending.transaction:type_name -> trisa.data.generic.v1beta1.Transaction + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_trisa_data_generic_v1beta1_transaction_proto_init() } @@ -295,6 +437,18 @@ func file_trisa_data_generic_v1beta1_transaction_proto_init() { } } file_trisa_data_generic_v1beta1_transaction_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pending); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_trisa_data_generic_v1beta1_transaction_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ConfirmationReceipt); i { case 0: return &v.state @@ -313,7 +467,7 @@ func file_trisa_data_generic_v1beta1_transaction_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_trisa_data_generic_v1beta1_transaction_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/trisa/api/v1beta1/api.proto b/proto/trisa/api/v1beta1/api.proto index 096f5f3..ec04be2 100644 --- a/proto/trisa/api/v1beta1/api.proto +++ b/proto/trisa/api/v1beta1/api.proto @@ -10,7 +10,7 @@ import "trisa/api/v1beta1/errors.proto"; // The TRISANetwork service defines the peer-to-peer interactions between VASPs that are // necessary to conduct compliance information exchanges. All TRISA members must // implement all services described by the TRISA protocol to ensure that exchanges are -// conducted correctly and securely. The primary RPCs are Transfer and TransactionStream +// conducted correctly and securely. The primary RPCs are Transfer and TransferStream // which allow VASPs to exchange compliance information before conducting a virtual // asset transaction. The other RPCs facilitate Transfers, allowing address // confirmations prior to a transfer and public key exchange so that transaction @@ -45,6 +45,9 @@ service TRISANetwork { // Because a down TRISA node will prevent travel rule compliant virtual asset // transactions, the health service is intended to quickly identify network problems and // notify members as quickly as possible. +// +// NOTE: the TRISAHealth service must also be behind mTLS so that the health check +// service can verify the identity certificates being used for the TRISANetwork service. service TRISAHealth { rpc Status(HealthCheck) returns (ServiceState) {} } @@ -56,42 +59,76 @@ service TRISAHealth { // the blockchain layer) and provides the necessary information so that only the // originator and the beneficiary can decrypt the trnasaction data. message SecureEnvelope { - // The transaction identifier generated by the sender. Any response - // to a transaction request needs to carry the same identifier. + // The transaction identifier generated by the sender. Any message concerning the + // same blockhain transaction requires the same envelope ID on both sending and + // responding RPCs. string id = 1; - // Encrypted Payload + // Encrypted payload that contains the IVMS 101 IdentityPayload for compliance and + // a generic transaction payload that is used to identify the transaction on the + // blockchain or perform flow control messages in TRISA itself. This payload should + // be encrypted using the encryption algorithm and key defined below. bytes payload = 2; - // Encryption key used to encrypt the transaction blob. This key itself - // is encrypted using the public key of the receiver. + // Encryption key used to encrypt the compliance payload, usually generated on a + // per-envelope basis. To seal the envelope, this key should be encrypted with the + // public key of the recipient. If this key is in the clear, the sealed flag should + // be false. bytes encryption_key = 3; - // The encryption algorithm used to encrypt the transaction blob. + // The encryption algorithm used to encrypt the compliance payload. This string + // should provide enough information for the recipient to understand how to decrypt + // the payload including algorithm, variants, block length, etc. string encryption_algorithm = 4; - // HMAC signature calculated from encrypted transaction blob. + // HMAC signature calculated from encrypted encrypted compliance payload using the + // hmac algorithm and secret defined below. This signature provides non-repudiation + // to regulators and counterparties that ensure the envelope has not been tampered + // with after receipt, particularly when comparing two envelopes. bytes hmac = 5; - // The HMAC secret used to calculate the HMAC signature. This secret - // itself is encrypted using the public key of the receiver. + // The HMAC secret used to calculate the HMAC signature. To seal the envelope, this + // secret should be encrypted with the public key of the recipient. If this secret + // is in the clear, the sealed flag should be false. bytes hmac_secret = 6; - // The algorithm used to calculate the HMAC signature. + // The algorithm used to calculate the HMAC signature. This string should provide + // enough information for the recipient to understand how to compute the HMAC + // including algorithm, block length, hashing function, etc. string hmac_algorithm = 7; - // Rejection errors are used inside of a streaming context so that the stream is - // not closed when an exchange-related rejection occurs. In the unary case, errors - // are directly returned rather than as part of the secure envelope. + // Rejection/TRISA errors should be specified in the SecureEnvelope for correct + // compliance processing and not returned as a gRPC error. E.g. if the counterparty + // wishes to send a TRISA error, they should send an OK gRPC response with the error + // in this field. Networking errors such as unavailable, mTLS failure, or timeouts + // are handled separately from compliance-related errors. Error error = 9; + + // The RFC-3339 formatted timestamp at nanosecond resolution. Used to order + // SecureEnvelopes related to the same transaction. While this timestamp is likely + // the same as the sent_at timestamp in the compliance payload, it does not serve + // the same purpose. The compliance payload timestamps are for non-repudiation, + // whereas this timestamp is for envelope and communication management. + string timestamp = 10; + + // Metadata related to the public key cryptography that seal the envelope by + // encrypting the encryption key and hmac secret such that only the recipient can + // fully decrypt the envelope. If the envelope is sealed, it indicates that the + // encryption key and hmac secret are encrypted with a public key, whose signature + // can be used for the recipient to identify the key pair required for decryption. + bool sealed = 11; + string public_key_signature = 12; } -// Payload is the expected message structure that will be parsed from the encrypted -// secure envelope. The Payload should contain the identity and transaction information -// for the information exchange. The internal message types are purposefully generic to -// allow flexibility with the data needs for different exchanges. +// Payload contains the compliance identity information that must be exchanged in a +// secure fashion, transaction information for both counterparties to uniquely identify +// the transaction on the chain, and timestamps that are used for regulatory +// non-repudiation. This payload is serialized and encrypted to be sent in the +// SecureEnvelope as well as digitally signed to ensure that the payload has not been +// tampered with after transmission. The internal message types of the payload are +// purposefully generic to allow flexibility with the data needs for different exchanges. message Payload { - // Identity contains any valid identity structure. The recommended format is the + // Identity contains any valid identity structure. The expected format is the // IVMS101 IdentityPayload which contains the originator and beneficiary identities, // the originator and beneficiary VASP identities, as well as the transfer path of // any intermediate VASPs. The identity payload can be bidirectional (containing @@ -102,7 +139,17 @@ message Payload { google.protobuf.Any identity = 1; // Transaction contains network specific information about the exchange or transfer. + // It can also contain transfer control messages such as Pending messages to + // facilitate multi-message compliance exchanges. These messages must all be + // digtially signed for auditing purposes. google.protobuf.Any transaction = 2; + + // Timestamps that describe when the payload was originally sent and when it was + // accepted or received by the counterparty. These timestamps must be in the payload + // so that they are digitally signed for non-repudiation. Both timestamps should be + // RFC-3339 formatted strings with timezone information. + string sent_at = 3; + string received_at = 4; } // TODO: specify the address confirmation protocol. diff --git a/proto/trisa/data/generic/v1beta1/transaction.proto b/proto/trisa/data/generic/v1beta1/transaction.proto index 0b669d4..06174df 100644 --- a/proto/trisa/data/generic/v1beta1/transaction.proto +++ b/proto/trisa/data/generic/v1beta1/transaction.proto @@ -20,9 +20,27 @@ message Transaction { string tag = 9; // optional memo/destination-tag required by some ledgers to identify transactions } -// A confirmation receipt is a generic reply to a TRISA transfer that may not have a -// beneficiary response, e.g. in the case where the originator collects all the KYC -// information. This is a convienience message for sending generic responses. +// A control flow message to support asynchronous TRISA transfers. Pending messages can +// be returned as an intermediate response during a compliance transfer if further +// processing is required before a response can be sent. The Pending message should +// provide information to the originator about when they can expect a response via the +// reply_not_before and reply_not_after timestamps. The Pending message should also +// provide collation information such as the envelope_id and original transaction so +// that the response message can be matched to the original request. +message Pending { + string envelope_id = 1; // the TRISA envelope ID that refers to the compliance communication + string received_by = 2; // the name of the recipient or recipient VASP + string received_at = 3; // the RFC3339 formatted timestamp when the request was received + string message = 4; // an optional message to respond with to the counterparty + string reply_not_after = 5; // the RFC3339 formatted timestamp when the response will be returned by + string reply_not_before = 6; // the RFC339 formatted timestamp that the response will not be sent before + string extra_json = 7; // any extra data as a JSON formatted object + Transaction transaction = 15; // the original transaction for reference +} + +// DEPRECATED: the ConfirmationReceipt message was deemed to cause confusion as it could +// signal that the confirmation payload was received and the transfer is concluded. Use +// the Pending message instead to signal that this is a control flow message. message ConfirmationReceipt { string envelope_id = 1; // the TRISA envelope ID for reference string received_by = 2; // name of the recipient or recipient VASP