Pix Ledger is a high-integrity banking core simulation designed to handle financial transactions with cryptographic security. Unlike traditional ledgers, this project implements a per-account Blockchain structure.
Every transaction generates a cryptographic hash based on its data (Amount, Timestamp, ID) and the hash of the previous transaction. This ensures:
- Immutability: History cannot be rewritten.
- Fraud Detection: Any manual alteration in the database breaks the hash chain, making it detectable by the audit system.
- Double-Entry Consistency: Transfers are atomic operations creating strictly coupled Debit and Credit records.
- Core: C# / .NET 10
- Database: PostgreSQL
- Architecture: Clean Architecture & Domain-Driven Design (DDD)
- Containerization: Docker & Docker Compose.
- Immutable Ledger: Uses SHA-256 chaining to guarantee data integrity.
- Double-Entry Bookkeeping: Ensures mathematical consistency.
- Optimistic Locking: Prevents race conditions during simultaneous transactions.
- Auditability: Built-in mechanism to traverse and verify the entire transaction chain.
-
Clone the repository:
git clone [https://github.com/LXSCA7/pix-ledger.git](https://github.com/LXSCA7/pix-ledger.git) cd pix-ledger -
Start Infrastructure (Postgres):
docker compose up -d
-
Apply Migrations:
dotnet ef database update --project src/PixLedger.Infrastructure --startup-project src/PixLedger.Api
-
Run the API:
dotnet run --project src/PixLedger.Api
Pix Ledger é uma simulação de core bancário de alta integridade projetado para processar transações financeiras com segurança criptográfica. Diferente de ledgers tradicionais, este projeto implementa uma estrutura de Blockchain por conta.
Cada transação gera um hash criptográfico baseado em seus dados (Valor, Timestamp, ID) e no hash da transação anterior. Isso garante:
- Imutabilidade: O histórico não pode ser reescrito.
- Detecção de Fraude: Qualquer alteração manual no banco de dados quebra a corrente de hash, sendo detectada pelo sistema de auditoria.
- Consistência de Dupla Entrada: Transferências são operações atômicas que criam registros de Débito e Crédito estritamente acoplados.
- Core: C# / .NET 10
- Banco de Dados: PostgreSQL
- Arquitetura: Clean Architecture & Domain-Driven Design (DDD)
- Containerização: Docker & Docker Compose.
- Ledger Imutável: Uso de encadeamento SHA-256 para garantir integridade.
- Contabilidade de Dupla Entrada: Garante consistência matemática nas transações.
- Travas Otimistas: Previne condições de corrida em transações simultâneas.
- Auditabilidade: Mecanismo nativo para reconstruir e verificar toda a cadeia de transações.
-
Clone o repositório:
git clone [https://github.com/LXSCA7/pix-ledger.git](https://github.com/LXSCA7/pix-ledger.git) cd pix-ledger -
Suba a Infraestrutura (Postgres):
docker compose up -d
-
Aplique as migrations:
dotnet ef database update --project src/PixLedger.Infrastructure --startup-project src/PixLedger.Api
-
Rode a API:
dotnet run --project src/PixLedger.Api