DHT Peer Finder
A library that joins the BitTorrent Mainline DHT and uses it to discover other peers running the same library. Bencode, node IDs, k-buckets and the routing table are all written from scratch on top of raw UDP.
Bartłomiej Kochanek · KotreQKotreQ — algorithms & securityHi, I’m BartłomiejBartłomiej KochanekKotreQ · kotreq.me
CS student from Poland. Algorithms, peer-to-peer networks and cybersecurity, and doing quite unusual things with code.I take problems apart until they become graphs, search trees and probabilities, then put them back together as working code.From a BitTorrent DHT client to a game-playing MCTS agent: I build things from scratch to understand exactly how they work.A computer science student who writes his own crypto, his own peer discovery and his own solvers, because the libraries hide the interesting part.Cybersecurity, algorithms and low-level networking. I read the protocol, model the problem and look for where it breaks.
Bartłomiej Kochanek · KotreQKotreQ — algorithms & securityHi, I’m BartłomiejBartłomiej KochanekKotreQ · kotreq.me
CS student from Poland. Algorithms, peer-to-peer networks and cybersecurity, and doing quite unusual things with code.I take problems apart until they become graphs, search trees and probabilities, then put them back together as working code.From a BitTorrent DHT client to a game-playing MCTS agent: I build things from scratch to understand exactly how they work.A computer science student who writes his own crypto, his own peer discovery and his own solvers, because the libraries hide the interesting part.Cybersecurity, algorithms and low-level networking. I read the protocol, model the problem and look for where it breaks.
Bartłomiej Kochanek · KotreQKotreQ — algorithms & securityHi, I’m BartłomiejBartłomiej KochanekKotreQ · kotreq.me
CS student from Poland. Algorithms, peer-to-peer networks and cybersecurity, and doing quite unusual things with code.I take problems apart until they become graphs, search trees and probabilities, then put them back together as working code.From a BitTorrent DHT client to a game-playing MCTS agent: I build things from scratch to understand exactly how they work.A computer science student who writes his own crypto, his own peer discovery and his own solvers, because the libraries hide the interesting part.Cybersecurity, algorithms and low-level networking. I read the protocol, model the problem and look for where it breaks.
Bartłomiej Kochanek · KotreQKotreQ — algorithms & securityHi, I’m BartłomiejBartłomiej KochanekKotreQ · kotreq.me
CS student from Poland. Algorithms, peer-to-peer networks and cybersecurity, and doing quite unusual things with code.I take problems apart until they become graphs, search trees and probabilities, then put them back together as working code.From a BitTorrent DHT client to a game-playing MCTS agent: I build things from scratch to understand exactly how they work.A computer science student who writes his own crypto, his own peer discovery and his own solvers, because the libraries hide the interesting part.Cybersecurity, algorithms and low-level networking. I read the protocol, model the problem and look for where it breaks.
kotreq@kotreq.me:~./monitor --net 10.0.0.0/16
Bartłomiej Kochanek · KotreQKotreQ — algorithms & securityHi, I’m BartłomiejBartłomiej KochanekKotreQ · kotreq.me
CS student from Poland. Algorithms, peer-to-peer networks and cybersecurity, and doing quite unusual things with code.I take problems apart until they become graphs, search trees and probabilities, then put them back together as working code.From a BitTorrent DHT client to a game-playing MCTS agent: I build things from scratch to understand exactly how they work.A computer science student who writes his own crypto, his own peer discovery and his own solvers, because the libraries hide the interesting part.Cybersecurity, algorithms and low-level networking. I read the protocol, model the problem and look for where it breaks.
about
I’m Bartłomiej, a computer science student from Poland. I like the moment a messy problem turns out to be a graph, a search or a probability question.
Most of what I build starts with “how does that actually work?” and ends with my own implementation: a DHT client, RSA from first principles, a solver that plays Minesweeper better than I do.
Libraries are great until you need to know what they are doing. So I write the protocol parser, the routing table and the cipher myself, and keep what I learn.
Right now that means algorithms coursework, game AI and a growing interest in how systems fail under attack.
Security is the reason I started digging into how software really works. To defend a system you have to understand it better than the person who built it.
That curiosity spilled into algorithms and networking: peer-to-peer discovery, game-tree search, probability and crypto.
I enjoy competitive-programming-style problems: find the structure, pick the right algorithm, write the least code that is obviously correct.
Outside of exercises I apply the same approach to real systems, from BitTorrent’s DHT to an exchange’s order book.
CS student from Poland, passionate about cybersecurity and doing quite unusual things with code.
If there is a protocol to reverse, a search space to prune or a puzzle to automate, I’m probably already on it.
about
~whoami
Bartłomiej Kochanek (KotreQ)
~cat about.txt
I’m Bartłomiej, a computer science student from Poland. I like the moment a messy problem turns out to be a graph, a search or a probability question.
Most of what I build starts with “how does that actually work?” and ends with my own implementation: a DHT client, RSA from first principles, a solver that plays Minesweeper better than I do.
Libraries are great until you need to know what they are doing. So I write the protocol parser, the routing table and the cipher myself, and keep what I learn.
Right now that means algorithms coursework, game AI and a growing interest in how systems fail under attack.
Security is the reason I started digging into how software really works. To defend a system you have to understand it better than the person who built it.
That curiosity spilled into algorithms and networking: peer-to-peer discovery, game-tree search, probability and crypto.
I enjoy competitive-programming-style problems: find the structure, pick the right algorithm, write the least code that is obviously correct.
Outside of exercises I apply the same approach to real systems, from BitTorrent’s DHT to an exchange’s order book.
CS student from Poland, passionate about cybersecurity and doing quite unusual things with code.
If there is a protocol to reverse, a search space to prune or a puzzle to automate, I’m probably already on it.
~cat facts.json
{
"based in": "Poland",
"studying": "Computer Science",
"focus": "algorithms · security · P2P",
"writes": "Python, mostly from scratch",
"open source": "8 public repos"
}~
about
I’m Bartłomiej, a computer science student from Poland. I like the moment a messy problem turns out to be a graph, a search or a probability question.
Most of what I build starts with “how does that actually work?” and ends with my own implementation: a DHT client, RSA from first principles, a solver that plays Minesweeper better than I do.
Libraries are great until you need to know what they are doing. So I write the protocol parser, the routing table and the cipher myself, and keep what I learn.
Right now that means algorithms coursework, game AI and a growing interest in how systems fail under attack.
Security is the reason I started digging into how software really works. To defend a system you have to understand it better than the person who built it.
That curiosity spilled into algorithms and networking: peer-to-peer discovery, game-tree search, probability and crypto.
I enjoy competitive-programming-style problems: find the structure, pick the right algorithm, write the least code that is obviously correct.
Outside of exercises I apply the same approach to real systems, from BitTorrent’s DHT to an exchange’s order book.
CS student from Poland, passionate about cybersecurity and doing quite unusual things with code.
If there is a protocol to reverse, a search space to prune or a puzzle to automate, I’m probably already on it.
about
I’m Bartłomiej, a computer science student from Poland. I like the moment a messy problem turns out to be a graph, a search or a probability question.
Most of what I build starts with “how does that actually work?” and ends with my own implementation: a DHT client, RSA from first principles, a solver that plays Minesweeper better than I do.
Libraries are great until you need to know what they are doing. So I write the protocol parser, the routing table and the cipher myself, and keep what I learn.
Right now that means algorithms coursework, game AI and a growing interest in how systems fail under attack.
Security is the reason I started digging into how software really works. To defend a system you have to understand it better than the person who built it.
That curiosity spilled into algorithms and networking: peer-to-peer discovery, game-tree search, probability and crypto.
I enjoy competitive-programming-style problems: find the structure, pick the right algorithm, write the least code that is obviously correct.
Outside of exercises I apply the same approach to real systems, from BitTorrent’s DHT to an exchange’s order book.
CS student from Poland, passionate about cybersecurity and doing quite unusual things with code.
If there is a protocol to reverse, a search space to prune or a puzzle to automate, I’m probably already on it.
about
I’m Bartłomiej, a computer science student from Poland. I like the moment a messy problem turns out to be a graph, a search or a probability question.
Most of what I build starts with “how does that actually work?” and ends with my own implementation: a DHT client, RSA from first principles, a solver that plays Minesweeper better than I do.
Libraries are great until you need to know what they are doing. So I write the protocol parser, the routing table and the cipher myself, and keep what I learn.
Right now that means algorithms coursework, game AI and a growing interest in how systems fail under attack.
Security is the reason I started digging into how software really works. To defend a system you have to understand it better than the person who built it.
That curiosity spilled into algorithms and networking: peer-to-peer discovery, game-tree search, probability and crypto.
I enjoy competitive-programming-style problems: find the structure, pick the right algorithm, write the least code that is obviously correct.
Outside of exercises I apply the same approach to real systems, from BitTorrent’s DHT to an exchange’s order book.
CS student from Poland, passionate about cybersecurity and doing quite unusual things with code.
If there is a protocol to reverse, a search space to prune or a puzzle to automate, I’m probably already on it.
2020
Joins GitHub as KotreQ.
2023
Writes a BitTorrent DHT client to find peers with no server in between.
2024
Builds a test harness for competitive programming.
2025
Implements RSA, CRC and PRNGs from first principles.
2026
MCTS game AI, a Minesweeper solver, an order book and more.
projects
Everything here is open source on GitHub, written from scratch.Peer-to-peer networking, game AI, solvers and crypto, each one to learn how it really works.Real repositories you can clone, read and break.Every project started as a question. These are the answers.A directory listing of the things I spend my evenings on.
Finds other peers over the BitTorrent Mainline DHT, with no tracker and no central server.
A Monte Carlo Tree Search agent for the dice game Knucklebones.
A bot that plays Minesweeper by working out the probability of a mine under every tile.
RSA, CRC, prime generation and random number generators with no crypto library.
An order book that matches buy and sell orders like an exchange does.
Runs a program against input/output test cases and shows coloured diffs of what went wrong.
Binomial sampling and a weight tree for O(log n) weighted random picks.
Heapsort, quicksort, union-find and solved algorithm exam problems with their test suites.
projects
Everything here is open source on GitHub, written from scratch.Peer-to-peer networking, game AI, solvers and crypto, each one to learn how it really works.Real repositories you can clone, read and break.Every project started as a question. These are the answers.A directory listing of the things I spend my evenings on.
projects
Everything here is open source on GitHub, written from scratch.Peer-to-peer networking, game AI, solvers and crypto, each one to learn how it really works.Real repositories you can clone, read and break.Every project started as a question. These are the answers.A directory listing of the things I spend my evenings on.
~/projectsls -la --sort=time
total 8
~/projects
projects
Everything here is open source on GitHub, written from scratch.Peer-to-peer networking, game AI, solvers and crypto, each one to learn how it really works.Real repositories you can clone, read and break.Every project started as a question. These are the answers.A directory listing of the things I spend my evenings on.
A library that joins the BitTorrent Mainline DHT and uses it to discover other peers running the same library. Bencode, node IDs, k-buckets and the routing table are all written from scratch on top of raw UDP.
Game engine, board state and a CLI to play against an agent that searches the game tree with MCTS: UCB1 selection, random rollouts and backpropagation of results.
A bot that plays Minesweeper by working out the probability of a mine under every tile.
RSA, CRC, prime generation and random number generators with no crypto library.
An order book that matches buy and sell orders like an exchange does.
Runs a program against input/output test cases and shows coloured diffs of what went wrong.
Binomial sampling and a weight tree for O(log n) weighted random picks.
Heapsort, quicksort, union-find and solved algorithm exam problems with their test suites.
projects
Everything here is open source on GitHub, written from scratch.Peer-to-peer networking, game AI, solvers and crypto, each one to learn how it really works.Real repositories you can clone, read and break.Every project started as a question. These are the answers.A directory listing of the things I spend my evenings on.
A library that joins the BitTorrent Mainline DHT and uses it to discover other peers running the same library. Bencode, node IDs, k-buckets and the routing table are all written from scratch on top of raw UDP.
Game engine, board state and a CLI to play against an agent that searches the game tree with MCTS: UCB1 selection, random rollouts and backpropagation of results.
Solver and playable game share one logic engine, with pluggable solving strategies and a GUI that shows the bot thinking.
Cryptographic building blocks implemented by hand to see exactly how they work, and where they break: modular arithmetic, prime search, PRNGs, RSA and CRC checksums.
A limit order book with price-time priority matching, the core data structure of every exchange.
A command-line test harness for competitive programming: feeds .in files to any program, compares with .out files and prints readable diffs.
Small, fast randomness helpers: a binomial sampler and a tree that picks weighted items in logarithmic time.
Course work and exam solutions for algorithms and data structures, each problem with its own tests.
skills
Three areas I keep coming back to.Algorithms and techniques I have implemented myself, not just used.Algorithms for the search, security for the edge cases, systems for the real world.The structures behind the projects, and what they cost.How the pieces fit together.
skills
Three areas I keep coming back to.Algorithms and techniques I have implemented myself, not just used.Algorithms for the search, security for the edge cases, systems for the real world.The structures behind the projects, and what they cost.How the pieces fit together.
skills
Three areas I keep coming back to.Algorithms and techniques I have implemented myself, not just used.Algorithms for the search, security for the edge cases, systems for the real world.The structures behind the projects, and what they cost.How the pieces fit together.
Algorithms
Security & crypto
Systems & networks
skills
Three areas I keep coming back to.Algorithms and techniques I have implemented myself, not just used.Algorithms for the search, security for the edge cases, systems for the real world.The structures behind the projects, and what they cost.How the pieces fit together.
Graph search
Monte Carlo Tree Search
Probabilistic inference
Heaps & sorting
Union-find
Weighted sampling
RSA from scratch
CRC checksums
Prime generation
PRNGs
Binary protocol parsing
Thinking like an attacker
BitTorrent Mainline DHT
Kademlia routing
UDP & bencode
Order matching
Test harnesses
Python
skills
Three areas I keep coming back to.Algorithms and techniques I have implemented myself, not just used.Algorithms for the search, security for the edge cases, systems for the real world.The structures behind the projects, and what they cost.How the pieces fit together.
~tree skills
skills/
├── algorithms/
│ ├── Graph search
│ ├── Monte Carlo Tree Search
│ ├── Probabilistic inference
│ ├── Heaps & sorting
│ ├── Union-find
│ └── Weighted sampling
├── security-crypto/
│ ├── RSA from scratch
│ ├── CRC checksums
│ ├── Prime generation
│ ├── PRNGs
│ ├── Binary protocol parsing
│ └── Thinking like an attacker
└── systems-networks/
├── BitTorrent Mainline DHT
├── Kademlia routing
├── UDP & bencode
├── Order matching
├── Test harnesses
└── Python
3 directories, 18 files
contact
Send it my way. I like the ones nobody else wants to touch.Projects, collaborations, CTF teams or just an interesting puzzle.The handshake starts on GitHub.Questions about any of the projects, or an idea to build together.I usually reply faster than a DHT lookup.
contact
Send it my way. I like the ones nobody else wants to touch.Projects, collaborations, CTF teams or just an interesting puzzle.The handshake starts on GitHub.Questions about any of the projects, or an idea to build together.I usually reply faster than a DHT lookup.
~./contact.sh --list
githubgithub.com/KotreQ
websitekotreq.me
latest repoknucklebones-ai
~open github
→ Find me on GitHubOpen GitHub profileSYN → github.com/KotreQMessage me on GitHubgithub.com/KotreQ
~
contact
Send it my way. I like the ones nobody else wants to touch.Projects, collaborations, CTF teams or just an interesting puzzle.The handshake starts on GitHub.Questions about any of the projects, or an idea to build together.I usually reply faster than a DHT lookup.
contact
Send it my way. I like the ones nobody else wants to touch.Projects, collaborations, CTF teams or just an interesting puzzle.The handshake starts on GitHub.Questions about any of the projects, or an idea to build together.I usually reply faster than a DHT lookup.
Got a hard problem?Let’s connect.Open a connection.Say hello.Ping me. — Find me on GitHubOpen GitHub profileSYN → github.com/KotreQMessage me on GitHubgithub.com/KotreQ
Send it my way. I like the ones nobody else wants to touch.Projects, collaborations, CTF teams or just an interesting puzzle.The handshake starts on GitHub.Questions about any of the projects, or an idea to build together.I usually reply faster than a DHT lookup.