{"id":31572179,"url":"https://github.com/rhodey/lock.host-python","last_synced_at":"2026-04-12T22:34:52.811Z","repository":{"id":305415556,"uuid":"1016299559","full_name":"rhodey/lock.host-python","owner":"rhodey","description":"Lock.host python example","archived":false,"fork":false,"pushed_at":"2025-09-11T21:50:53.000Z","size":8903,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-21T23:58:18.967Z","etag":null,"topics":["crypto","enclave","ipfs"],"latest_commit_sha":null,"homepage":"https://lock.host","language":"Python","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/rhodey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-08T19:47:03.000Z","updated_at":"2025-09-11T21:50:57.000Z","dependencies_parsed_at":"2025-07-20T01:29:40.247Z","dependency_job_id":"78d29d65-de68-4466-8592-6d241b0536db","html_url":"https://github.com/rhodey/lock.host-python","commit_stats":null,"previous_names":["rhodey/lock.host-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rhodey/lock.host-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhodey%2Flock.host-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhodey%2Flock.host-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhodey%2Flock.host-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhodey%2Flock.host-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhodey","download_url":"https://codeload.github.com/rhodey/lock.host-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhodey%2Flock.host-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278464272,"owners_count":25991177,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["crypto","enclave","ipfs"],"created_at":"2025-10-05T13:49:43.923Z","updated_at":"2025-10-05T13:49:46.059Z","avatar_url":"https://github.com/rhodey.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lock.host-python\nLock.host python3 example, see: [lock.host](https://github.com/rhodey/lock.host)\n\nThis demonstration uses OpenAI to control a Solana wallet:\n+ Unmodified OpenAI lib\n+ Unmodified Solana solana-py lib\n+ Hit /api/ask?message=your best joke\u0026addr=abc123\n+ OAI is asked \"You are to decide if a joke is funny or not\"\n+ If so 0.001 SOL is sent to addr\n\n## Build app\nThis is how PCR hashes are checked:\n```\njust serve-alpine\njust build-app\n...\n{\n  \"Measurements\": {\n    \"HashAlgorithm\": \"Sha384 { ... }\",\n    \"PCR0\": \"ebd96daf5983f237d8be138b35f763b08967d8f16d04875f63b3a8622b283543fe702a264c7a08e62a62c5758cc585ce\",\n    \"PCR1\": \"4b4d5b3661b3efc12920900c80e126e4ce783c522de6c02a2a5bf7af3a2b9327b86776f188e4be1c1c404a129dbda493\",\n    \"PCR2\": \"220d7a6934ca98d60150ddaa94fc3d1446e92517d49afa00814419f4e20734acd6f9edc1d99643a46b7e3c3f88e9045f\"\n  }\n}\n```\n\nSee that [run.yml](.github/workflows/run.yml) step \"PCR\" is testing that PCRs in this readme match the build\n\n## Prod\n+ In prod all TEE I/O passes through /dev/vsock\n+ Think of /dev/vsock as a file handle\n+ How to run:\n```\njust serve-alpine\njust build-app\ncp example.env .env\njust run-app\njust run-host\n```\n\n## Test\n+ In test a container emulates a TEE\n+ Uses two fifos /tmp/read /tmp/write to emulate vsock\n+ How to run:\n```\njust serve-alpine\njust build-test-app\ncp example.env .env\njust run-test-app\njust run-test-host\njust add-funds\njust atsocat 8889 8888\njust ask-funds 8889\n...\naddr = A7xYaa6PGwUFGYY5FYfMrZe6HJp5pSY7dBthdnPNbFE\nsol = 0\njson = {\n  \"signature\": \"5s4EUD6R8q9YobVSxC2ntnTdyKaZT1vduPdafKJCbwNnD1cGk6cDJ4Ha4T3gjqMWGLBGUPaSadCPyCYfxEev846t\",\n  \"from\": \"DDWiwmkP5SiRExFmKSBWgfLNvDcq3B5eGXRvmvE6egGm\",\n  \"to\": \"A7xYaa6PGwUFGYY5FYfMrZe6HJp5pSY7dBthdnPNbFE\"\n}\nsol = 0.001\n```\n\n## Atsocat\nThe Lock.host runtime includes a utility named atsocat similar to [socat](https://linux.die.net/man/1/socat)\n\nAtsocat listens on one port (8889) and forwards to a second port (8888)\n\nAtsocat validates attestation documents and encrypts the session transparently\n\nA better example would pass an `HTTPAdapter` to the `requests` library so python would not need atsocat\n\n## Web\nThe webapp [IPFS-boot-choo](https://github.com/rhodey/IPFS-boot-choo) demonstrates lock.host in a client-to-server environment\n\nThe webapp when hitting dev (not prod) requires an HTTPS certificate to be installed with the OS\n\nThis is because of a combination of Lock.host using HTTP2 and IPFS-boot using a service worker\n\n+ just mkcert\n+ chrome \u003e settings \u003e privacy \u0026 security\n+ security \u003e manage certificates \u003e authorities\n+ import \u003e ca.crt\n\n## Apks\nModify apk/Dockerfile.fetch to include all apks then run:\n```\njust proxy-alpine\njust fetch-alpine\n```\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhodey%2Flock.host-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhodey%2Flock.host-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhodey%2Flock.host-python/lists"}