github.com/Bytom/bytom@v1.1.2-0.20210127130405-ae40204c0b09/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 Hash transaction_status_hash = 6; 58 uint64 nonce = 7; 59 uint64 bits = 8; 60 TransactionStatus transaction_status = 9; 61 } 62 63 message TxHeader { 64 uint64 version = 1; 65 uint64 serialized_size = 2; 66 uint64 time_range = 3; 67 repeated Hash result_ids = 4; 68 } 69 70 message TxVerifyResult { 71 bool status_fail = 1; 72 } 73 74 message TransactionStatus { 75 uint64 version = 1; 76 repeated TxVerifyResult verify_status = 2; 77 } 78 79 message Mux { 80 repeated ValueSource sources = 1; // issuances, spends, and muxes 81 Program program = 2; 82 repeated ValueDestination witness_destinations = 3; // outputs, retirements, and muxes 83 repeated bytes witness_arguments = 4; 84 } 85 86 message Coinbase { 87 ValueDestination witness_destination = 1; 88 bytes arbitrary = 2; 89 } 90 91 message Output { 92 ValueSource source = 1; 93 Program control_program = 2; 94 uint64 ordinal = 3; 95 } 96 97 message Retirement { 98 ValueSource source = 1; 99 uint64 ordinal = 2; 100 } 101 102 message Issuance { 103 Hash nonce_hash = 1; 104 AssetAmount value = 2; 105 ValueDestination witness_destination = 3; 106 AssetDefinition witness_asset_definition = 4; 107 repeated bytes witness_arguments = 5; 108 uint64 ordinal = 6; 109 } 110 111 message Spend { 112 Hash spent_output_id = 1; 113 ValueDestination witness_destination = 2; 114 repeated bytes witness_arguments = 3; 115 uint64 ordinal = 4; 116 }