mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-16 17:42:02 +00:00
common/protob: Add GetOwnershipId message.
This commit is contained in:
parent
534bce3f86
commit
533de50588
@ -82,6 +82,27 @@ message Address {
|
|||||||
required string address = 1; // Coin address in Base58 encoding
|
required string address = 1; // Coin address in Base58 encoding
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request: Ask device for ownership identifier corresponding to scriptPubKey for address_n path
|
||||||
|
* @start
|
||||||
|
* @next OwnershipId
|
||||||
|
* @next Failure
|
||||||
|
*/
|
||||||
|
message GetOwnershipId {
|
||||||
|
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
|
||||||
|
optional string coin_name = 2 [default='Bitcoin']; // coin to use
|
||||||
|
optional MultisigRedeemScriptType multisig = 3; // filled if we are dealing with a multisig scriptPubKey
|
||||||
|
optional InputScriptType script_type = 4 [default=SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Response: Contains the ownership identifier for the scriptPubKey and device private seed
|
||||||
|
* @end
|
||||||
|
*/
|
||||||
|
message OwnershipId {
|
||||||
|
required bytes ownership_id = 1; // ownership identifier
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request: Ask device to sign message
|
* Request: Ask device to sign message
|
||||||
* @start
|
* @start
|
||||||
|
@ -87,6 +87,8 @@ enum MessageType {
|
|||||||
MessageType_SignMessage = 38 [(wire_in) = true];
|
MessageType_SignMessage = 38 [(wire_in) = true];
|
||||||
MessageType_VerifyMessage = 39 [(wire_in) = true];
|
MessageType_VerifyMessage = 39 [(wire_in) = true];
|
||||||
MessageType_MessageSignature = 40 [(wire_out) = true];
|
MessageType_MessageSignature = 40 [(wire_out) = true];
|
||||||
|
MessageType_GetOwnershipId = 43 [(wire_in) = true];
|
||||||
|
MessageType_OwnershipId = 44 [(wire_out) = true];
|
||||||
MessageType_GetOwnershipProof = 49 [(wire_in) = true];
|
MessageType_GetOwnershipProof = 49 [(wire_in) = true];
|
||||||
MessageType_OwnershipProof = 50 [(wire_out) = true];
|
MessageType_OwnershipProof = 50 [(wire_out) = true];
|
||||||
|
|
||||||
|
38
core/src/trezor/messages/GetOwnershipId.py
Normal file
38
core/src/trezor/messages/GetOwnershipId.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
from .MultisigRedeemScriptType import MultisigRedeemScriptType
|
||||||
|
|
||||||
|
if __debug__:
|
||||||
|
try:
|
||||||
|
from typing import Dict, List # noqa: F401
|
||||||
|
from typing_extensions import Literal # noqa: F401
|
||||||
|
EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4]
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class GetOwnershipId(p.MessageType):
|
||||||
|
MESSAGE_WIRE_TYPE = 43
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
address_n: List[int] = None,
|
||||||
|
coin_name: str = None,
|
||||||
|
multisig: MultisigRedeemScriptType = None,
|
||||||
|
script_type: EnumTypeInputScriptType = None,
|
||||||
|
) -> None:
|
||||||
|
self.address_n = address_n if address_n is not None else []
|
||||||
|
self.coin_name = coin_name
|
||||||
|
self.multisig = multisig
|
||||||
|
self.script_type = script_type
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_fields(cls) -> Dict:
|
||||||
|
return {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('coin_name', p.UnicodeType, 0), # default=Bitcoin
|
||||||
|
3: ('multisig', MultisigRedeemScriptType, 0),
|
||||||
|
4: ('script_type', p.EnumType("InputScriptType", (0, 1, 2, 3, 4)), 0), # default=SPENDADDRESS
|
||||||
|
}
|
@ -55,6 +55,8 @@ Address = 30 # type: Literal[30]
|
|||||||
SignMessage = 38 # type: Literal[38]
|
SignMessage = 38 # type: Literal[38]
|
||||||
VerifyMessage = 39 # type: Literal[39]
|
VerifyMessage = 39 # type: Literal[39]
|
||||||
MessageSignature = 40 # type: Literal[40]
|
MessageSignature = 40 # type: Literal[40]
|
||||||
|
GetOwnershipId = 43 # type: Literal[43]
|
||||||
|
OwnershipId = 44 # type: Literal[44]
|
||||||
GetOwnershipProof = 49 # type: Literal[49]
|
GetOwnershipProof = 49 # type: Literal[49]
|
||||||
OwnershipProof = 50 # type: Literal[50]
|
OwnershipProof = 50 # type: Literal[50]
|
||||||
CipherKeyValue = 23 # type: Literal[23]
|
CipherKeyValue = 23 # type: Literal[23]
|
||||||
|
26
core/src/trezor/messages/OwnershipId.py
Normal file
26
core/src/trezor/messages/OwnershipId.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
import protobuf as p
|
||||||
|
|
||||||
|
if __debug__:
|
||||||
|
try:
|
||||||
|
from typing import Dict, List # noqa: F401
|
||||||
|
from typing_extensions import Literal # noqa: F401
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class OwnershipId(p.MessageType):
|
||||||
|
MESSAGE_WIRE_TYPE = 44
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
ownership_id: bytes = None,
|
||||||
|
) -> None:
|
||||||
|
self.ownership_id = ownership_id
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_fields(cls) -> Dict:
|
||||||
|
return {
|
||||||
|
1: ('ownership_id', p.BytesType, 0), # required
|
||||||
|
}
|
@ -4,7 +4,7 @@ endif
|
|||||||
|
|
||||||
SKIPPED_MESSAGES := Binance Cardano DebugMonero Eos Monero Ontology Ripple SdProtect Tezos WebAuthn \
|
SKIPPED_MESSAGES := Binance Cardano DebugMonero Eos Monero Ontology Ripple SdProtect Tezos WebAuthn \
|
||||||
DebugLinkRecordScreen DebugLinkReseedRandom DebugLinkShowText DebugLinkEraseSdCard DebugLinkWatchLayout \
|
DebugLinkRecordScreen DebugLinkReseedRandom DebugLinkShowText DebugLinkEraseSdCard DebugLinkWatchLayout \
|
||||||
GetOwnershipProof OwnershipProof
|
GetOwnershipProof OwnershipProof GetOwnershipId OwnershipId
|
||||||
|
|
||||||
ifeq ($(BITCOIN_ONLY), 1)
|
ifeq ($(BITCOIN_ONLY), 1)
|
||||||
SKIPPED_MESSAGES += Ethereum Lisk NEM Stellar
|
SKIPPED_MESSAGES += Ethereum Lisk NEM Stellar
|
||||||
|
@ -59,3 +59,8 @@ GetOwnershipProof.commitment_data max_size:32
|
|||||||
|
|
||||||
OwnershipProof.ownership_proof max_size:171
|
OwnershipProof.ownership_proof max_size:171
|
||||||
OwnershipProof.signature max_size:65
|
OwnershipProof.signature max_size:65
|
||||||
|
|
||||||
|
GetOwnershipId.address_n max_count:8
|
||||||
|
GetOwnershipId.coin_name max_size:21
|
||||||
|
|
||||||
|
OwnershipId.ownership_id max_size:32
|
||||||
|
38
python/src/trezorlib/messages/GetOwnershipId.py
Normal file
38
python/src/trezorlib/messages/GetOwnershipId.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
from .. import protobuf as p
|
||||||
|
|
||||||
|
from .MultisigRedeemScriptType import MultisigRedeemScriptType
|
||||||
|
|
||||||
|
if __debug__:
|
||||||
|
try:
|
||||||
|
from typing import Dict, List # noqa: F401
|
||||||
|
from typing_extensions import Literal # noqa: F401
|
||||||
|
EnumTypeInputScriptType = Literal[0, 1, 2, 3, 4]
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class GetOwnershipId(p.MessageType):
|
||||||
|
MESSAGE_WIRE_TYPE = 43
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
address_n: List[int] = None,
|
||||||
|
coin_name: str = None,
|
||||||
|
multisig: MultisigRedeemScriptType = None,
|
||||||
|
script_type: EnumTypeInputScriptType = None,
|
||||||
|
) -> None:
|
||||||
|
self.address_n = address_n if address_n is not None else []
|
||||||
|
self.coin_name = coin_name
|
||||||
|
self.multisig = multisig
|
||||||
|
self.script_type = script_type
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_fields(cls) -> Dict:
|
||||||
|
return {
|
||||||
|
1: ('address_n', p.UVarintType, p.FLAG_REPEATED),
|
||||||
|
2: ('coin_name', p.UnicodeType, 0), # default=Bitcoin
|
||||||
|
3: ('multisig', MultisigRedeemScriptType, 0),
|
||||||
|
4: ('script_type', p.EnumType("InputScriptType", (0, 1, 2, 3, 4)), 0), # default=SPENDADDRESS
|
||||||
|
}
|
@ -53,6 +53,8 @@ Address = 30 # type: Literal[30]
|
|||||||
SignMessage = 38 # type: Literal[38]
|
SignMessage = 38 # type: Literal[38]
|
||||||
VerifyMessage = 39 # type: Literal[39]
|
VerifyMessage = 39 # type: Literal[39]
|
||||||
MessageSignature = 40 # type: Literal[40]
|
MessageSignature = 40 # type: Literal[40]
|
||||||
|
GetOwnershipId = 43 # type: Literal[43]
|
||||||
|
OwnershipId = 44 # type: Literal[44]
|
||||||
GetOwnershipProof = 49 # type: Literal[49]
|
GetOwnershipProof = 49 # type: Literal[49]
|
||||||
OwnershipProof = 50 # type: Literal[50]
|
OwnershipProof = 50 # type: Literal[50]
|
||||||
CipherKeyValue = 23 # type: Literal[23]
|
CipherKeyValue = 23 # type: Literal[23]
|
||||||
|
26
python/src/trezorlib/messages/OwnershipId.py
Normal file
26
python/src/trezorlib/messages/OwnershipId.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
from .. import protobuf as p
|
||||||
|
|
||||||
|
if __debug__:
|
||||||
|
try:
|
||||||
|
from typing import Dict, List # noqa: F401
|
||||||
|
from typing_extensions import Literal # noqa: F401
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class OwnershipId(p.MessageType):
|
||||||
|
MESSAGE_WIRE_TYPE = 44
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
ownership_id: bytes = None,
|
||||||
|
) -> None:
|
||||||
|
self.ownership_id = ownership_id
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_fields(cls) -> Dict:
|
||||||
|
return {
|
||||||
|
1: ('ownership_id', p.BytesType, 0), # required
|
||||||
|
}
|
@ -111,6 +111,7 @@ from .GetECDHSessionKey import GetECDHSessionKey
|
|||||||
from .GetEntropy import GetEntropy
|
from .GetEntropy import GetEntropy
|
||||||
from .GetFeatures import GetFeatures
|
from .GetFeatures import GetFeatures
|
||||||
from .GetNextU2FCounter import GetNextU2FCounter
|
from .GetNextU2FCounter import GetNextU2FCounter
|
||||||
|
from .GetOwnershipId import GetOwnershipId
|
||||||
from .GetOwnershipProof import GetOwnershipProof
|
from .GetOwnershipProof import GetOwnershipProof
|
||||||
from .GetPublicKey import GetPublicKey
|
from .GetPublicKey import GetPublicKey
|
||||||
from .HDNodePathType import HDNodePathType
|
from .HDNodePathType import HDNodePathType
|
||||||
@ -200,6 +201,7 @@ from .NEMSignedTx import NEMSignedTx
|
|||||||
from .NEMTransactionCommon import NEMTransactionCommon
|
from .NEMTransactionCommon import NEMTransactionCommon
|
||||||
from .NEMTransfer import NEMTransfer
|
from .NEMTransfer import NEMTransfer
|
||||||
from .NextU2FCounter import NextU2FCounter
|
from .NextU2FCounter import NextU2FCounter
|
||||||
|
from .OwnershipId import OwnershipId
|
||||||
from .OwnershipProof import OwnershipProof
|
from .OwnershipProof import OwnershipProof
|
||||||
from .PassphraseAck import PassphraseAck
|
from .PassphraseAck import PassphraseAck
|
||||||
from .PassphraseRequest import PassphraseRequest
|
from .PassphraseRequest import PassphraseRequest
|
||||||
|
Loading…
Reference in New Issue
Block a user