github.com/bytom/bytom@v1.1.2-0.20221014091027-bbcba3df6075/protocol/bc/bc.proto (about) 1 syntax = "proto3"; 2 3 package bc; 4 5 message Hash { 6 fixed64 v0 = 1; 7 fixed64 v1 = 2; 8 fixed64 v2 = 3; 9 fixed64 v3 = 4; 10 } 11 12 message Program { 13 uint64 vm_version = 1; 14 bytes code = 2; 15 } 16 17 // This message type duplicates Hash, above. One alternative is to 18 // embed a Hash inside an AssetID. But it's useful for AssetID to be 19 // plain old data (without pointers). Another alternative is use Hash 20 // in any protobuf types where an AssetID is called for, but it's 21 // preferable to have type safety. 22 message AssetID { 23 fixed64 v0 = 1; 24 fixed64 v1 = 2; 25 fixed64 v2 = 3; 26 fixed64 v3 = 4; 27 } 28 29 message AssetAmount { 30 AssetID asset_id = 1; 31 uint64 amount = 2; 32 } 33 34 message AssetDefinition { 35 Program issuance_program = 1; 36 Hash data = 2; 37 } 38 39 message ValueSource { 40 Hash ref = 1; 41 AssetAmount value = 2; 42 uint64 position = 3; 43 } 44 45 message ValueDestination { 46 Hash ref = 1; 47 AssetAmount value = 2; 48 uint64 position = 3; 49 } 50 51 message BlockHeader { 52 uint64 version = 1; 53 uint64 height = 2; 54 Hash previous_block_id = 3; 55 uint64 timestamp = 4; 56 Hash transactions_root = 5; 57 } 58 59 message TxHeader { 60 uint64 version = 1; 61 uint64 serialized_size = 2; 62 uint64 time_range = 3; 63 repeated Hash result_ids = 4; 64 } 65 66 message Mux { 67 repeated ValueSource sources = 1; // issuances, spends, and muxes 68 Program program = 2; 69 repeated ValueDestination witness_destinations = 3; // outputs, retirements, and muxes 70 repeated bytes witness_arguments = 4; 71 } 72 73 message Coinbase { 74 ValueDestination witness_destination = 1; 75 bytes arbitrary = 2; 76 } 77 78 message OriginalOutput { 79 ValueSource source = 1; 80 Program control_program = 2; 81 uint64 ordinal = 3; 82 repeated bytes state_data = 4; 83 } 84 85 message VoteOutput { 86 ValueSource source = 1; 87 Program control_program = 2; 88 uint64 ordinal = 3; 89 bytes vote = 4; 90 repeated bytes state_data = 5; 91 } 92 93 message VetoInput { 94 Hash spent_output_id = 1; 95 ValueDestination witness_destination = 2; 96 repeated bytes witness_arguments = 3; 97 uint64 ordinal = 4; 98 } 99 100 message Retirement { 101 ValueSource source = 1; 102 uint64 ordinal = 2; 103 } 104 105 message Issuance { 106 Hash nonce_hash = 1; 107 AssetAmount value = 2; 108 ValueDestination witness_destination = 3; 109 AssetDefinition witness_asset_definition = 4; 110 repeated bytes witness_arguments = 5; 111 uint64 ordinal = 6; 112 } 113 114 message Spend { 115 Hash spent_output_id = 1; 116 ValueDestination witness_destination = 2; 117 repeated bytes witness_arguments = 3; 118 uint64 ordinal = 4; 119 }