{"id":22672670,"url":"https://github.com/jimlynchcodes/eth-thenticated-nodejs-requests","last_synced_at":"2025-03-29T11:26:50.500Z","repository":{"id":74887682,"uuid":"420471000","full_name":"JimLynchCodes/eth-thenticated-nodejs-requests","owner":"JimLynchCodes","description":"Example of validating sender address of a post request on a nodejs backend","archived":false,"fork":false,"pushed_at":"2021-10-26T23:19:58.000Z","size":1392,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-04T12:01:38.482Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/JimLynchCodes.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,"publiccode":null,"codemeta":null}},"created_at":"2021-10-23T16:55:02.000Z","updated_at":"2021-10-26T23:21:43.000Z","dependencies_parsed_at":"2023-02-26T21:15:59.588Z","dependency_job_id":null,"html_url":"https://github.com/JimLynchCodes/eth-thenticated-nodejs-requests","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/JimLynchCodes%2Feth-thenticated-nodejs-requests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimLynchCodes%2Feth-thenticated-nodejs-requests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimLynchCodes%2Feth-thenticated-nodejs-requests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JimLynchCodes%2Feth-thenticated-nodejs-requests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JimLynchCodes","download_url":"https://codeload.github.com/JimLynchCodes/eth-thenticated-nodejs-requests/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246176758,"owners_count":20735843,"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":[],"created_at":"2024-12-09T16:20:12.365Z","updated_at":"2025-03-29T11:26:50.468Z","avatar_url":"https://github.com/JimLynchCodes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eth-thenticated-nodejs-requests\nExample of validating sender address of a post request on a nodejs backend\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n# What's Here\n\n\u003cbr/\u003e\n\n\u003cimg src=\"./eth-thenticated-nodejs-example.png\"/\u003e\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n##  1. Frontend\n\nA react project (made with create-react-app) that has only one button- \"send stuff\" which sends some json data and the signed request.\n\nNote that this project ***does not connect to any smart contract***.\n\nInstead, it uses metamask and web3 to create a signed message and then sends it off to our nodejs backend server.\n\n{\n   sender: \"0x123123123123\",\n   number: 15,\n   action: \"attack\"\n}\n\n```\nnpm start\n```\n\n##  2. Backend\n\nAn express.js server-side node.js project with a single post endpoint, handling the \"send stuff\" call from our single button.\n\nThis project also uses web3, but instead of singing a message it uses the \"web3.eth.accounts.recover\" to recover the signer address.\n\nWe return an error if the user tries to call with a post body where \"sender\" is different from the signer address. \n\n_This then gives us a \"msg.sender\" guarantee in node.js the same as we have in solidity!_\n\n```\nnpm start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimlynchcodes%2Feth-thenticated-nodejs-requests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimlynchcodes%2Feth-thenticated-nodejs-requests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimlynchcodes%2Feth-thenticated-nodejs-requests/lists"}