thrylos

package module
v0.0.0-...-d0f1153 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2025 License: MIT Imports: 4 Imported by: 0

README

Thrylos Blockchain Project

Welcome to our Blockchain Project, an open-source blockchain, developed in Go. This platform emphasizes security, efficiency, and decentralization, offering a robust solution for maintaining a transparent ledger.

Quick Start

Jump into action with these simple steps:

  1. Set Up: Clone the repository to your local machine.

  2. Generate AES Key: This key needs to be generated for encryption.

  3. Create a .env file: in the .env file it needs to have the following:

ENV=development HTTP_NODE_ADDRESS=localhost:8546 GRPC_NODE_ADDRESS=localhost:50051 WS_NODE_ADDRESS=localhost:8444 DOMAIN_NAME= PEERS=XXXXXXXXX DATA=./blockchain_data TESTNET=true AES_KEY_ENV_VAR=XXXXXXXXX DATA_DIR=/database GENESIS_ACCOUNT=XXXXXXXXX GAS_ESTIMATE_URL=https://localhost:8546/api/gas-estimate

  1. Run_Thrylos: Execute ./run_thrylos.sh in your terminal to run thyrlos testnet in development. Try 'run_thrylos' just in the terminal

How to run manaully without using run_thrylos.sh:

Navigate: In terminal change directory to cd cmd/thrylos.

Run: Execute 'export ENV=development' in your terminal.

Run: Execute 'go run .' in your terminal.

If you delete the blockchain_data the account and balances will be wiped

Inside the Blockchain

Dive deeper into the core components that power our blockchain:

Blocks
  • Purpose: Serve as the backbone, housing transactions, linking to the previous block via hash, and ensuring integrity through their own hash.
  • Role: Create an immutable chain, securing the ledger's history.
Transactions
  • Function: Facilitate asset exchange between parties, backed by signatures for authenticity.
  • Significance: Act as the heartbeat of our blockchain, enabling decentralized finance.
Blockchain
  • Description: A chain of blocks, each connected by hashes, functioning as the public ledger for all transactions.
  • Utility: Ensures transparency, security, and accessibility of transaction records.

Data Management

Badger Database
  • Utility: Stores blockchain data (blocks and transactions), ensuring durability and swift access.
  • Features: Offers a solid foundation for blockchain persistence and efficient data queries.
BlockchainDB
  • Overview: An abstraction over Badger, tailored for blockchain operations.
  • Capabilities: Handles transaction additions, UTXO retrieval, and UTXO set updates, streamlining database interactions.

How transactions flow through the system

Entry Point:

Transaction Entry: Client submits a signed transaction System performs basic validation (signature, format, etc.)

Parallel Processing: DAG Manager: Needs 5+ references to confirm transaction Modern Processor: Verifies transaction validity and details Both must complete before proceeding

State Management: System determines which shard handles the addresses (using tl1 prefix) Updates state in the correct partition Manages balances and UTXOs for that address range

Block Creation: Validated transactions go to pending pool Creates blocks when:

100 transactions are ready (batch size), or Every 200ms if transactions are pending Processes transactions in batches

Final Updates: Updates balances in the appropriate shards Cleans up transaction state Notifies relevant parts of the system

The key innovation is that each step knows which shard to interact with based on the address prefix (tl1), allowing the system to scale horizontally.

When are blocks created

blocks are only created when there are pending transactions (hasPendingTx := len(node.PendingTransactions) > 0) and enough time has passed since the last block (timeSinceLastBlock >= targetBlockTime)

The system checks these conditions every 200ms (checkInterval). Two ways blocks get triggered:

Timer based: If pending transactions exist and block time requirement is met Batch based: When pending transactions reach batch size (100 transactions)

If no transactions are being sent through the system:

No blocks will be created The timer will keep checking but take no action System remains idle until new transactions arrive

This is efficient because we're not creating empty blocks unnecessarily - blocks are only created when there's actual work to be done.

Interfacing with the Blockchain

HTTP Server
  • Initiation: Launches alongside the blockchain, opening a gateway for user interactions on a designated port.
  • Endpoints: Features a variety of access points for blockchain interaction, including transaction submissions and status checks.
Handling Requests
  • Process: Parses and validates incoming requests, translating them into blockchain actions like adding transactions or validating the chain's integrity.

Efficient Data Handling

Protobuf Serialization
  • Advantage: Ensures data is compact and efficiently stored or transmitted, using Google's Protobuf for serialization.
  • Conversion: Bridges the gap between Go's native data structures and Protobuf's binary format, facilitating seamless data operations.

VerkleTree

  • Purpose: Enhances the efficiency and scalability of data storage and retrieval in the blockchain.
  • Functionality: Implements a novel data structure for organizing transactions in a compact, efficient manner, reducing the size of proof and improving verification times.
  • Integration: Used within the blockchain to form a succinct, cryptographically secure representation of transaction states, facilitating quicker and lighter consensus verification.

Engaging with the Blockchain

  1. Start: Initialization kicks off with the blockchain and HTTP server, loading the current state from the database.
  2. Interact: Submit transactions, query data, and explore the blockchain through our intuitive HTTP endpoints.
  3. Contribute: Enhance the ecosystem by adding transactions, creating blocks, and maintaining the network's integrity.

Contributing

Join our mission to make decentralized transactions the norm. Here's how you can contribute:

  • Get Started: Fork the repo, then create a feature or bug fix branch.
  • Follow Guidelines: Adhere to our coding standards and commit message conventions.
  • Test Rigorously: Ensure your changes are thoroughly tested.
  • Submit a PR: Push your branch and open a pull request.
Community Guidelines

We're committed to fostering an inclusive environment. Please review our Code of Conduct to understand our community standards.

Reporting Security Issues

Stumbled upon a security flaw? Email us at hello@thrylos.org. Let's keep our discussions private until we've addressed the issue.

License

This project is proudly licensed under the MIT License. For more details, see the LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_transactions_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type BalanceMessage

type BalanceMessage struct {
	BlockchainAddress string  `protobuf:"bytes,1,opt,name=blockchain_address,json=blockchainAddress,proto3" json:"blockchain_address,omitempty"` // The address receiving the balance update
	Balance           int64   `protobuf:"varint,2,opt,name=balance,proto3" json:"balance,omitempty"`                                             // Balance in nanoTHRYLOS
	BalanceThrylos    float64 `protobuf:"fixed64,3,opt,name=balance_thrylos,json=balanceThrylos,proto3" json:"balance_thrylos,omitempty"`        // Balance converted to THRYLOS
	// contains filtered or unexported fields
}

WebSocket balance update message

func (*BalanceMessage) Descriptor deprecated

func (*BalanceMessage) Descriptor() ([]byte, []int)

Deprecated: Use BalanceMessage.ProtoReflect.Descriptor instead.

func (*BalanceMessage) GetBalance

func (x *BalanceMessage) GetBalance() int64

func (*BalanceMessage) GetBalanceThrylos

func (x *BalanceMessage) GetBalanceThrylos() float64

func (*BalanceMessage) GetBlockchainAddress

func (x *BalanceMessage) GetBlockchainAddress() string

func (*BalanceMessage) ProtoMessage

func (*BalanceMessage) ProtoMessage()

func (*BalanceMessage) ProtoReflect

func (x *BalanceMessage) ProtoReflect() protoreflect.Message

func (*BalanceMessage) Reset

func (x *BalanceMessage) Reset()

func (*BalanceMessage) String

func (x *BalanceMessage) String() string

type BalanceResponse

type BalanceResponse struct {
	Balance           int64   `protobuf:"varint,1,opt,name=balance,proto3" json:"balance,omitempty"`                                             // Balance in nanoTHRYLOS
	BalanceThrylos    float64 `protobuf:"fixed64,2,opt,name=balance_thrylos,json=balanceThrylos,proto3" json:"balance_thrylos,omitempty"`        // Balance in THRYLOS
	BlockchainAddress string  `protobuf:"bytes,3,opt,name=blockchain_address,json=blockchainAddress,proto3" json:"blockchain_address,omitempty"` // The address queried
	// contains filtered or unexported fields
}

func (*BalanceResponse) Descriptor deprecated

func (*BalanceResponse) Descriptor() ([]byte, []int)

Deprecated: Use BalanceResponse.ProtoReflect.Descriptor instead.

func (*BalanceResponse) GetBalance

func (x *BalanceResponse) GetBalance() int64

func (*BalanceResponse) GetBalanceThrylos

func (x *BalanceResponse) GetBalanceThrylos() float64

func (*BalanceResponse) GetBlockchainAddress

func (x *BalanceResponse) GetBlockchainAddress() string

func (*BalanceResponse) ProtoMessage

func (*BalanceResponse) ProtoMessage()

func (*BalanceResponse) ProtoReflect

func (x *BalanceResponse) ProtoReflect() protoreflect.Message

func (*BalanceResponse) Reset

func (x *BalanceResponse) Reset()

func (*BalanceResponse) String

func (x *BalanceResponse) String() string

type BalanceSubscriptionRequest

type BalanceSubscriptionRequest struct {
	BlockchainAddress string `protobuf:"bytes,1,opt,name=blockchain_address,json=blockchainAddress,proto3" json:"blockchain_address,omitempty"`
	// contains filtered or unexported fields
}

func (*BalanceSubscriptionRequest) Descriptor deprecated

func (*BalanceSubscriptionRequest) Descriptor() ([]byte, []int)

Deprecated: Use BalanceSubscriptionRequest.ProtoReflect.Descriptor instead.

func (*BalanceSubscriptionRequest) GetBlockchainAddress

func (x *BalanceSubscriptionRequest) GetBlockchainAddress() string

func (*BalanceSubscriptionRequest) ProtoMessage

func (*BalanceSubscriptionRequest) ProtoMessage()

func (*BalanceSubscriptionRequest) ProtoReflect

func (*BalanceSubscriptionRequest) Reset

func (x *BalanceSubscriptionRequest) Reset()

func (*BalanceSubscriptionRequest) String

func (x *BalanceSubscriptionRequest) String() string

type Block

type Block struct {
	Index        int32          `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	Timestamp    int64          `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	PrevHash     []byte         `protobuf:"bytes,3,opt,name=prev_hash,json=prevHash,proto3" json:"prev_hash,omitempty"`
	Validator    string         `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"`
	Transactions []*Transaction `protobuf:"bytes,5,rep,name=transactions,proto3" json:"transactions,omitempty"`
	Hash         []byte         `protobuf:"bytes,6,opt,name=hash,proto3" json:"hash,omitempty"`
	Signature    []byte         `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` // If not already present
	Salt         []byte         `protobuf:"bytes,8,opt,name=salt,proto3" json:"salt,omitempty"`           // Add this for MLDSA signature scheme
	// contains filtered or unexported fields
}

New Block message

func (*Block) Descriptor deprecated

func (*Block) Descriptor() ([]byte, []int)

Deprecated: Use Block.ProtoReflect.Descriptor instead.

func (*Block) GetHash

func (x *Block) GetHash() []byte

func (*Block) GetIndex

func (x *Block) GetIndex() int32

func (*Block) GetPrevHash

func (x *Block) GetPrevHash() []byte

func (*Block) GetSalt

func (x *Block) GetSalt() []byte

func (*Block) GetSignature

func (x *Block) GetSignature() []byte

func (*Block) GetTimestamp

func (x *Block) GetTimestamp() int64

func (*Block) GetTransactions

func (x *Block) GetTransactions() []*Transaction

func (*Block) GetValidator

func (x *Block) GetValidator() string

func (*Block) ProtoMessage

func (*Block) ProtoMessage()

func (*Block) ProtoReflect

func (x *Block) ProtoReflect() protoreflect.Message

func (*Block) Reset

func (x *Block) Reset()

func (*Block) String

func (x *Block) String() string

type BlockResponse

type BlockResponse struct {
	Block *Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"`
	// contains filtered or unexported fields
}

func (*BlockResponse) Descriptor deprecated

func (*BlockResponse) Descriptor() ([]byte, []int)

Deprecated: Use BlockResponse.ProtoReflect.Descriptor instead.

func (*BlockResponse) GetBlock

func (x *BlockResponse) GetBlock() *Block

func (*BlockResponse) ProtoMessage

func (*BlockResponse) ProtoMessage()

func (*BlockResponse) ProtoReflect

func (x *BlockResponse) ProtoReflect() protoreflect.Message

func (*BlockResponse) Reset

func (x *BlockResponse) Reset()

func (*BlockResponse) String

func (x *BlockResponse) String() string

type EmptyRequest

type EmptyRequest struct {
	// contains filtered or unexported fields
}

func (*EmptyRequest) Descriptor deprecated

func (*EmptyRequest) Descriptor() ([]byte, []int)

Deprecated: Use EmptyRequest.ProtoReflect.Descriptor instead.

func (*EmptyRequest) ProtoMessage

func (*EmptyRequest) ProtoMessage()

func (*EmptyRequest) ProtoReflect

func (x *EmptyRequest) ProtoReflect() protoreflect.Message

func (*EmptyRequest) Reset

func (x *EmptyRequest) Reset()

func (*EmptyRequest) String

func (x *EmptyRequest) String() string

type FailedTransaction

type FailedTransaction struct {
	TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` // The ID of the transaction
	ErrorMessage  string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`    // Error message explaining why the transaction failed
	// contains filtered or unexported fields
}

func (*FailedTransaction) Descriptor deprecated

func (*FailedTransaction) Descriptor() ([]byte, []int)

Deprecated: Use FailedTransaction.ProtoReflect.Descriptor instead.

func (*FailedTransaction) GetErrorMessage

func (x *FailedTransaction) GetErrorMessage() string

func (*FailedTransaction) GetTransactionId

func (x *FailedTransaction) GetTransactionId() string

func (*FailedTransaction) ProtoMessage

func (*FailedTransaction) ProtoMessage()

func (*FailedTransaction) ProtoReflect

func (x *FailedTransaction) ProtoReflect() protoreflect.Message

func (*FailedTransaction) Reset

func (x *FailedTransaction) Reset()

func (*FailedTransaction) String

func (x *FailedTransaction) String() string

type GetBalanceRequest

type GetBalanceRequest struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The blockchain address for which the balance is requested
	// contains filtered or unexported fields
}

func (*GetBalanceRequest) Descriptor deprecated

func (*GetBalanceRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetBalanceRequest.ProtoReflect.Descriptor instead.

func (*GetBalanceRequest) GetAddress

func (x *GetBalanceRequest) GetAddress() string

func (*GetBalanceRequest) ProtoMessage

func (*GetBalanceRequest) ProtoMessage()

func (*GetBalanceRequest) ProtoReflect

func (x *GetBalanceRequest) ProtoReflect() protoreflect.Message

func (*GetBalanceRequest) Reset

func (x *GetBalanceRequest) Reset()

func (*GetBalanceRequest) String

func (x *GetBalanceRequest) String() string

type GetBlockByHashRequest

type GetBlockByHashRequest struct {
	Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

func (*GetBlockByHashRequest) Descriptor deprecated

func (*GetBlockByHashRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetBlockByHashRequest.ProtoReflect.Descriptor instead.

func (*GetBlockByHashRequest) GetHash

func (x *GetBlockByHashRequest) GetHash() []byte

func (*GetBlockByHashRequest) ProtoMessage

func (*GetBlockByHashRequest) ProtoMessage()

func (*GetBlockByHashRequest) ProtoReflect

func (x *GetBlockByHashRequest) ProtoReflect() protoreflect.Message

func (*GetBlockByHashRequest) Reset

func (x *GetBlockByHashRequest) Reset()

func (*GetBlockByHashRequest) String

func (x *GetBlockByHashRequest) String() string

type GetBlockByIndexRequest

type GetBlockByIndexRequest struct {
	Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	// contains filtered or unexported fields
}

func (*GetBlockByIndexRequest) Descriptor deprecated

func (*GetBlockByIndexRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetBlockByIndexRequest.ProtoReflect.Descriptor instead.

func (*GetBlockByIndexRequest) GetIndex

func (x *GetBlockByIndexRequest) GetIndex() int32

func (*GetBlockByIndexRequest) ProtoMessage

func (*GetBlockByIndexRequest) ProtoMessage()

func (*GetBlockByIndexRequest) ProtoReflect

func (x *GetBlockByIndexRequest) ProtoReflect() protoreflect.Message

func (*GetBlockByIndexRequest) Reset

func (x *GetBlockByIndexRequest) Reset()

func (*GetBlockByIndexRequest) String

func (x *GetBlockByIndexRequest) String() string

type GetBlockRequest

type GetBlockRequest struct {
	Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetBlockRequest) Descriptor deprecated

func (*GetBlockRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetBlockRequest.ProtoReflect.Descriptor instead.

func (*GetBlockRequest) GetId

func (x *GetBlockRequest) GetId() int32

func (*GetBlockRequest) ProtoMessage

func (*GetBlockRequest) ProtoMessage()

func (*GetBlockRequest) ProtoReflect

func (x *GetBlockRequest) ProtoReflect() protoreflect.Message

func (*GetBlockRequest) Reset

func (x *GetBlockRequest) Reset()

func (*GetBlockRequest) String

func (x *GetBlockRequest) String() string

type GetPendingTransactionsRequest

type GetPendingTransactionsRequest struct {
	// contains filtered or unexported fields
}

func (*GetPendingTransactionsRequest) Descriptor deprecated

func (*GetPendingTransactionsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetPendingTransactionsRequest.ProtoReflect.Descriptor instead.

func (*GetPendingTransactionsRequest) ProtoMessage

func (*GetPendingTransactionsRequest) ProtoMessage()

func (*GetPendingTransactionsRequest) ProtoReflect

func (*GetPendingTransactionsRequest) Reset

func (x *GetPendingTransactionsRequest) Reset()

func (*GetPendingTransactionsRequest) String

type GetStatsRequest

type GetStatsRequest struct {
	// contains filtered or unexported fields
}

func (*GetStatsRequest) Descriptor deprecated

func (*GetStatsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetStatsRequest.ProtoReflect.Descriptor instead.

func (*GetStatsRequest) ProtoMessage

func (*GetStatsRequest) ProtoMessage()

func (*GetStatsRequest) ProtoReflect

func (x *GetStatsRequest) ProtoReflect() protoreflect.Message

func (*GetStatsRequest) Reset

func (x *GetStatsRequest) Reset()

func (*GetStatsRequest) String

func (x *GetStatsRequest) String() string

type GetTransactionRequest

type GetTransactionRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTransactionRequest) Descriptor deprecated

func (*GetTransactionRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetTransactionRequest.ProtoReflect.Descriptor instead.

func (*GetTransactionRequest) GetId

func (x *GetTransactionRequest) GetId() string

func (*GetTransactionRequest) ProtoMessage

func (*GetTransactionRequest) ProtoMessage()

func (*GetTransactionRequest) ProtoReflect

func (x *GetTransactionRequest) ProtoReflect() protoreflect.Message

func (*GetTransactionRequest) Reset

func (x *GetTransactionRequest) Reset()

func (*GetTransactionRequest) String

func (x *GetTransactionRequest) String() string

type Input

type Input struct {
	PreviousTx   string `protobuf:"bytes,1,opt,name=previousTx,proto3" json:"previousTx,omitempty"`
	Index        int32  `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
	Signature    string `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
	OwnerAddress string `protobuf:"bytes,4,opt,name=ownerAddress,proto3" json:"ownerAddress,omitempty"`
	// contains filtered or unexported fields
}

func (*Input) Descriptor deprecated

func (*Input) Descriptor() ([]byte, []int)

Deprecated: Use Input.ProtoReflect.Descriptor instead.

func (*Input) GetIndex

func (x *Input) GetIndex() int32

func (*Input) GetOwnerAddress

func (x *Input) GetOwnerAddress() string

func (*Input) GetPreviousTx

func (x *Input) GetPreviousTx() string

func (*Input) GetSignature

func (x *Input) GetSignature() string

func (*Input) ProtoMessage

func (*Input) ProtoMessage()

func (*Input) ProtoReflect

func (x *Input) ProtoReflect() protoreflect.Message

func (*Input) Reset

func (x *Input) Reset()

func (*Input) String

func (x *Input) String() string

type Output

type Output struct {
	Amount  float64 `protobuf:"fixed64,1,opt,name=amount,proto3" json:"amount,omitempty"`
	Address string  `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// contains filtered or unexported fields
}

func (*Output) Descriptor deprecated

func (*Output) Descriptor() ([]byte, []int)

Deprecated: Use Output.ProtoReflect.Descriptor instead.

func (*Output) GetAddress

func (x *Output) GetAddress() string

func (*Output) GetAmount

func (x *Output) GetAmount() float64

func (*Output) ProtoMessage

func (*Output) ProtoMessage()

func (*Output) ProtoReflect

func (x *Output) ProtoReflect() protoreflect.Message

func (*Output) Reset

func (x *Output) Reset()

func (*Output) String

func (x *Output) String() string

type PendingTransactionsResponse

type PendingTransactionsResponse struct {
	Transactions string `protobuf:"bytes,1,opt,name=transactions,proto3" json:"transactions,omitempty"`
	// contains filtered or unexported fields
}

func (*PendingTransactionsResponse) Descriptor deprecated

func (*PendingTransactionsResponse) Descriptor() ([]byte, []int)

Deprecated: Use PendingTransactionsResponse.ProtoReflect.Descriptor instead.

func (*PendingTransactionsResponse) GetTransactions

func (x *PendingTransactionsResponse) GetTransactions() string

func (*PendingTransactionsResponse) ProtoMessage

func (*PendingTransactionsResponse) ProtoMessage()

func (*PendingTransactionsResponse) ProtoReflect

func (*PendingTransactionsResponse) Reset

func (x *PendingTransactionsResponse) Reset()

func (*PendingTransactionsResponse) String

func (x *PendingTransactionsResponse) String() string

type StatsResponse

type StatsResponse struct {
	Stats string `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"`
	// contains filtered or unexported fields
}

func (*StatsResponse) Descriptor deprecated

func (*StatsResponse) Descriptor() ([]byte, []int)

Deprecated: Use StatsResponse.ProtoReflect.Descriptor instead.

func (*StatsResponse) GetStats

func (x *StatsResponse) GetStats() string

func (*StatsResponse) ProtoMessage

func (*StatsResponse) ProtoMessage()

func (*StatsResponse) ProtoReflect

func (x *StatsResponse) ProtoReflect() protoreflect.Message

func (*StatsResponse) Reset

func (x *StatsResponse) Reset()

func (*StatsResponse) String

func (x *StatsResponse) String() string

type Transaction

type Transaction struct {
	Id               string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Removed json_name, as it's redundant in proto3 when matching the field name exactly.
	Timestamp        int64    `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Inputs           []*UTXO  `protobuf:"bytes,3,rep,name=inputs,proto3" json:"inputs,omitempty"`
	Outputs          []*UTXO  `protobuf:"bytes,4,rep,name=outputs,proto3" json:"outputs,omitempty"`
	EncryptedInputs  []byte   `protobuf:"bytes,5,opt,name=encrypted_inputs,json=encryptedInputs,proto3" json:"encrypted_inputs,omitempty"`
	EncryptedOutputs []byte   `protobuf:"bytes,6,opt,name=encrypted_outputs,json=encryptedOutputs,proto3" json:"encrypted_outputs,omitempty"`
	Signature        []byte   `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"`                                      // Use bytes for binary data.
	PreviousTxIds    []string `protobuf:"bytes,8,rep,name=previous_tx_ids,json=previousTxIds,proto3" json:"previous_tx_ids,omitempty"`       // Consider if large, split loading.
	EncryptedAesKey  []byte   `protobuf:"bytes,9,opt,name=encrypted_aes_key,json=encryptedAesKey,proto3" json:"encrypted_aes_key,omitempty"` // Keep as bytes, ensure encryption keys are not logged or misused.
	Sender           string   `protobuf:"bytes,10,opt,name=sender,proto3" json:"sender,omitempty"`
	Gasfee           int32    `protobuf:"varint,11,opt,name=gasfee,proto3" json:"gasfee,omitempty"`                                           // Added gas fee field
	Status           string   `protobuf:"bytes,12,opt,name=status,proto3" json:"status,omitempty"`                                            // New field for transaction status
	BlockHash        []byte   `protobuf:"bytes,13,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"`                     // Changed from string to bytes
	SenderPublicKey  []byte   `protobuf:"bytes,14,opt,name=sender_public_key,json=senderPublicKey,proto3" json:"sender_public_key,omitempty"` // For ML-DSA44 public key when needed
	Salt             []byte   `protobuf:"bytes,15,opt,name=salt,proto3" json:"salt,omitempty"`
	// contains filtered or unexported fields
}

func (*Transaction) Descriptor deprecated

func (*Transaction) Descriptor() ([]byte, []int)

Deprecated: Use Transaction.ProtoReflect.Descriptor instead.

func (*Transaction) GetBlockHash

func (x *Transaction) GetBlockHash() []byte

func (*Transaction) GetEncryptedAesKey

func (x *Transaction) GetEncryptedAesKey() []byte

func (*Transaction) GetEncryptedInputs

func (x *Transaction) GetEncryptedInputs() []byte

func (*Transaction) GetEncryptedOutputs

func (x *Transaction) GetEncryptedOutputs() []byte

func (*Transaction) GetGasfee

func (x *Transaction) GetGasfee() int32

func (*Transaction) GetId

func (x *Transaction) GetId() string

func (*Transaction) GetInputs

func (x *Transaction) GetInputs() []*UTXO

func (*Transaction) GetOutputs

func (x *Transaction) GetOutputs() []*UTXO

func (*Transaction) GetPreviousTxIds

func (x *Transaction) GetPreviousTxIds() []string

func (*Transaction) GetSalt

func (x *Transaction) GetSalt() []byte

func (*Transaction) GetSender

func (x *Transaction) GetSender() string

func (*Transaction) GetSenderPublicKey

func (x *Transaction) GetSenderPublicKey() []byte

func (*Transaction) GetSignature

func (x *Transaction) GetSignature() []byte

func (*Transaction) GetStatus

func (x *Transaction) GetStatus() string

func (*Transaction) GetTimestamp

func (x *Transaction) GetTimestamp() int64

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) ProtoReflect

func (x *Transaction) ProtoReflect() protoreflect.Message

func (*Transaction) Reset

func (x *Transaction) Reset()

func (*Transaction) String

func (x *Transaction) String() string

type TransactionBatchRequest

type TransactionBatchRequest struct {
	Transactions []*Transaction `protobuf:"bytes,1,rep,name=transactions,proto3" json:"transactions,omitempty"` // List of transactions in a batch
	// contains filtered or unexported fields
}

func (*TransactionBatchRequest) Descriptor deprecated

func (*TransactionBatchRequest) Descriptor() ([]byte, []int)

Deprecated: Use TransactionBatchRequest.ProtoReflect.Descriptor instead.

func (*TransactionBatchRequest) GetTransactions

func (x *TransactionBatchRequest) GetTransactions() []*Transaction

func (*TransactionBatchRequest) ProtoMessage

func (*TransactionBatchRequest) ProtoMessage()

func (*TransactionBatchRequest) ProtoReflect

func (x *TransactionBatchRequest) ProtoReflect() protoreflect.Message

func (*TransactionBatchRequest) Reset

func (x *TransactionBatchRequest) Reset()

func (*TransactionBatchRequest) String

func (x *TransactionBatchRequest) String() string

type TransactionBatchResponse

type TransactionBatchResponse struct {
	Status             string               `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`                                                   // Status of the batch processing
	FailedTransactions []*FailedTransaction `protobuf:"bytes,2,rep,name=failed_transactions,json=failedTransactions,proto3" json:"failed_transactions,omitempty"` // Added to provide detailed error info
	// contains filtered or unexported fields
}

func (*TransactionBatchResponse) Descriptor deprecated

func (*TransactionBatchResponse) Descriptor() ([]byte, []int)

Deprecated: Use TransactionBatchResponse.ProtoReflect.Descriptor instead.

func (*TransactionBatchResponse) GetFailedTransactions

func (x *TransactionBatchResponse) GetFailedTransactions() []*FailedTransaction

func (*TransactionBatchResponse) GetStatus

func (x *TransactionBatchResponse) GetStatus() string

func (*TransactionBatchResponse) ProtoMessage

func (*TransactionBatchResponse) ProtoMessage()

func (*TransactionBatchResponse) ProtoReflect

func (x *TransactionBatchResponse) ProtoReflect() protoreflect.Message

func (*TransactionBatchResponse) Reset

func (x *TransactionBatchResponse) Reset()

func (*TransactionBatchResponse) String

func (x *TransactionBatchResponse) String() string

type TransactionJSON

type TransactionJSON struct {
	ID        string     `json:"id"`
	Timestamp int64      `json:"timestamp"`
	Inputs    []UTXOJSON `json:"inputs"`
	Outputs   []UTXOJSON `json:"outputs"`
	Signature string     `json:"signature"`
}

TransactionJSON mirrors the JSON structure of your transaction data

type TransactionRequest

type TransactionRequest struct {
	Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` // Embedding the Transaction message
	// contains filtered or unexported fields
}

func (*TransactionRequest) Descriptor deprecated

func (*TransactionRequest) Descriptor() ([]byte, []int)

Deprecated: Use TransactionRequest.ProtoReflect.Descriptor instead.

func (*TransactionRequest) GetTransaction

func (x *TransactionRequest) GetTransaction() *Transaction

func (*TransactionRequest) ProtoMessage

func (*TransactionRequest) ProtoMessage()

func (*TransactionRequest) ProtoReflect

func (x *TransactionRequest) ProtoReflect() protoreflect.Message

func (*TransactionRequest) Reset

func (x *TransactionRequest) Reset()

func (*TransactionRequest) String

func (x *TransactionRequest) String() string

type TransactionResponse

type TransactionResponse struct {
	Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*TransactionResponse) Descriptor deprecated

func (*TransactionResponse) Descriptor() ([]byte, []int)

Deprecated: Use TransactionResponse.ProtoReflect.Descriptor instead.

func (*TransactionResponse) GetStatus

func (x *TransactionResponse) GetStatus() string

func (*TransactionResponse) ProtoMessage

func (*TransactionResponse) ProtoMessage()

func (*TransactionResponse) ProtoReflect

func (x *TransactionResponse) ProtoReflect() protoreflect.Message

func (*TransactionResponse) Reset

func (x *TransactionResponse) Reset()

func (*TransactionResponse) String

func (x *TransactionResponse) String() string

type UTXO

type UTXO struct {
	TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
	Index         int32  `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
	OwnerAddress  string `protobuf:"bytes,3,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"`
	Amount        int64  `protobuf:"varint,4,opt,name=amount,proto3" json:"amount,omitempty"`
	IsSpent       bool   `protobuf:"varint,5,opt,name=is_spent,json=isSpent,proto3" json:"is_spent,omitempty"`
	// contains filtered or unexported fields
}

UTXO message optimized for size and clarity.

func (*UTXO) Descriptor deprecated

func (*UTXO) Descriptor() ([]byte, []int)

Deprecated: Use UTXO.ProtoReflect.Descriptor instead.

func (*UTXO) GetAmount

func (x *UTXO) GetAmount() int64

func (*UTXO) GetIndex

func (x *UTXO) GetIndex() int32

func (*UTXO) GetIsSpent

func (x *UTXO) GetIsSpent() bool

func (*UTXO) GetOwnerAddress

func (x *UTXO) GetOwnerAddress() string

func (*UTXO) GetTransactionId

func (x *UTXO) GetTransactionId() string

func (*UTXO) ProtoMessage

func (*UTXO) ProtoMessage()

func (*UTXO) ProtoReflect

func (x *UTXO) ProtoReflect() protoreflect.Message

func (*UTXO) Reset

func (x *UTXO) Reset()

func (*UTXO) String

func (x *UTXO) String() string

type UTXOJSON

type UTXOJSON struct {
	TransactionID string `json:"transactionId"`
	Index         int32  `json:"index"`
	OwnerAddress  string `json:"ownerAddress"`
	Amount        int64  `json:"amount"`
}

UTXOJSON mirrors the JSON structure of your UTXO data

Directories

Path Synopsis
cmd
thrylos command
generate_key.go (Temporary tool)
generate_key.go (Temporary tool)
consensus
detection
consensus/detection/behaviors.go
consensus/detection/behaviors.go
selection
consensus/selection/consensus.go
consensus/selection/consensus.go
privateKey.go (Revised for Exporting)
privateKey.go (Revised for Exporting)
types/sharding.go
types/sharding.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL