X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=vendor%2Fgithub.com%2Fbytom%2Fprotocol%2Fbc%2Fbc.proto;fp=vendor%2Fgithub.com%2Fbytom%2Fprotocol%2Fbc%2Fbc.proto;h=fb60c8fe3c3877a1c50ec2f4b6abf9f9cf08c785;hp=0000000000000000000000000000000000000000;hb=8da5d90ecadf13f1510dbbc4bce05645684142a2;hpb=0bd22d212b767702bd1c99edb05d5f3a57cb572c diff --git a/vendor/github.com/bytom/protocol/bc/bc.proto b/vendor/github.com/bytom/protocol/bc/bc.proto new file mode 100644 index 00000000..fb60c8fe --- /dev/null +++ b/vendor/github.com/bytom/protocol/bc/bc.proto @@ -0,0 +1,116 @@ +syntax = "proto3"; + +package bc; + +message Hash { + fixed64 v0 = 1; + fixed64 v1 = 2; + fixed64 v2 = 3; + fixed64 v3 = 4; +} + +message Program { + uint64 vm_version = 1; + bytes code = 2; +} + +// This message type duplicates Hash, above. One alternative is to +// embed a Hash inside an AssetID. But it's useful for AssetID to be +// plain old data (without pointers). Another alternative is use Hash +// in any protobuf types where an AssetID is called for, but it's +// preferable to have type safety. +message AssetID { + fixed64 v0 = 1; + fixed64 v1 = 2; + fixed64 v2 = 3; + fixed64 v3 = 4; +} + +message AssetAmount { + AssetID asset_id = 1; + uint64 amount = 2; +} + +message AssetDefinition { + Program issuance_program = 1; + Hash data = 2; +} + +message ValueSource { + Hash ref = 1; + AssetAmount value = 2; + uint64 position = 3; +} + +message ValueDestination { + Hash ref = 1; + AssetAmount value = 2; + uint64 position = 3; +} + +message BlockHeader { + uint64 version = 1; + uint64 height = 2; + Hash previous_block_id = 3; + uint64 timestamp = 4; + Hash transactions_root = 5; + Hash transaction_status_hash = 6; + uint64 nonce = 7; + uint64 bits = 8; + TransactionStatus transaction_status = 9; +} + +message TxHeader { + uint64 version = 1; + uint64 serialized_size = 2; + uint64 time_range = 3; + repeated Hash result_ids = 4; +} + +message TxVerifyResult { + bool status_fail = 1; +} + +message TransactionStatus { + uint64 version = 1; + repeated TxVerifyResult verify_status = 2; +} + +message Mux { + repeated ValueSource sources = 1; // issuances, spends, and muxes + Program program = 2; + repeated ValueDestination witness_destinations = 3; // outputs, retirements, and muxes + repeated bytes witness_arguments = 4; +} + +message Coinbase { + ValueDestination witness_destination = 1; + bytes arbitrary = 2; +} + +message Output { + ValueSource source = 1; + Program control_program = 2; + uint64 ordinal = 3; +} + +message Retirement { + ValueSource source = 1; + uint64 ordinal = 2; +} + +message Issuance { + Hash nonce_hash = 1; + AssetAmount value = 2; + ValueDestination witness_destination = 3; + AssetDefinition witness_asset_definition = 4; + repeated bytes witness_arguments = 5; + uint64 ordinal = 6; +} + +message Spend { + Hash spent_output_id = 1; + ValueDestination witness_destination = 2; + repeated bytes witness_arguments = 3; + uint64 ordinal = 4; +} \ No newline at end of file