{"id":13623033,"url":"https://github.com/lithdew/monte","last_synced_at":"2025-04-23T22:04:17.740Z","repository":{"id":107949725,"uuid":"271043858","full_name":"lithdew/monte","owner":"lithdew","description":"The bare minimum for high performance, fully-encrypted bidirectional RPC over TCP in Go with zero memory allocations.","archived":false,"fork":false,"pushed_at":"2020-06-22T09:06:25.000Z","size":83,"stargazers_count":119,"open_issues_count":2,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-23T22:04:11.666Z","etag":null,"topics":["aes-256","blake2b","golang","networking","p2p","tcp","tlv","x25519"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lithdew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-06-09T15:45:02.000Z","updated_at":"2024-08-03T14:56:48.000Z","dependencies_parsed_at":"2023-07-22T13:32:59.342Z","dependency_job_id":null,"html_url":"https://github.com/lithdew/monte","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithdew%2Fmonte","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithdew%2Fmonte/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithdew%2Fmonte/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithdew%2Fmonte/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lithdew","download_url":"https://codeload.github.com/lithdew/monte/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250522302,"owners_count":21444511,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes-256","blake2b","golang","networking","p2p","tcp","tlv","x25519"],"created_at":"2024-08-01T21:01:27.250Z","updated_at":"2025-04-23T22:04:17.470Z","avatar_url":"https://github.com/lithdew.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# monte\n\n[![MIT License](https://img.shields.io/apm/l/atomic-design-ui.svg?)](LICENSE)\n[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/lithdew/monte)\n[![Discord Chat](https://img.shields.io/discord/697002823123992617)](https://discord.gg/HZEbkeQ)\n\nThe bare minimum for high performance, fully-encrypted RPC over TCP in Go.\n\n## Features\n\n1. Send requests, receive responses, or send messages without waiting for a response.\n2. Send from 50MiB/s to 1500MiB/s, with zero allocations per sent message or RPC call.\n3. Gracefully establish multiple client connections to a single endpoint up to a configurable limit.\n4. Set the total number of connections that may concurrently be accepted and handled by a single endpoint.\n5. Configure read/write timeouts, dial timeouts, handshake timeouts, or customize the handshaking protocol.\n6. All messages, once the handshake protocol is complete, are encrypted and non-distinguishable from each other.\n7. Supports graceful shutdowns for both client and server, with extensive tests for highly-concurrent scenarios.\n\n## Protocol\n\n### Handshake\n\n1. Send X25519 curve point (32 bytes) to peer.\n2. Receive X25519 curve point (32 bytes) from our peer.\n3. Multiply X25519 curve scalar with X25519 curve point received from our peer.\n4. Derive a shared key by using BLAKE-2b as a key derivation function over our scalar point multiplication result.\n5. Encrypt further communication with AES 256-bit GCM using our shared key, with a nonce counter increasing for every\nincoming/outgoing message.\n\n### Message Format\n\n1. Encrypted messages are prefixed with an unsigned 32-bit integer denoting the message's length.\n2. The decoded message content is prefixed with an unsigned 32-bit integer designating a sequence number.\n3. The sequence number is used as an identifier to identify requests/responses from one another.\n4. The sequence number 0 is reserved for requests that do not expect a response.\n\n## Benchmarks\n\n```\n$ cat /proc/cpuinfo | grep 'model name' | uniq\nmodel name : Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz\n\n$ go test -bench=. -benchtime=10s\ngoos: linux\ngoarch: amd64\npkg: github.com/lithdew/monte\nBenchmarkSend-8                          1814391              6690 ns/op         209.27 MB/s         115 B/op          0 allocs/op\nBenchmarkSendNoWait-8                   10638730              1153 ns/op        1214.19 MB/s         141 B/op          0 allocs/op\nBenchmarkRequest-8                        438381             28556 ns/op          49.03 MB/s         140 B/op          0 allocs/op\nBenchmarkParallelSend-8                  4917001              2876 ns/op         486.70 MB/s         115 B/op          0 allocs/op\nBenchmarkParallelSendNoWait-8           10317255              1291 ns/op        1084.78 MB/s         150 B/op          0 allocs/op\nBenchmarkParallelRequest-8               1341444              8520 ns/op         164.32 MB/s         140 B/op          0 allocs/op\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flithdew%2Fmonte","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flithdew%2Fmonte","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flithdew%2Fmonte/lists"}