MCPcopy Create free account
hub / github.com/NextDotID/proof_server / GeneratePostPayload

Method GeneratePostPayload

validator/github/github.go:50–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48}
49
50func (gh *Github) GeneratePostPayload() (post map[string]string) {
51 gh.Identity = strings.ToLower(gh.Identity)
52 payload := gistPayload{
53 Version: "1",
54 Comment: "Here's an NextID proof of this Github account.",
55 Comment2: "To validate, base64.decode the signature, and recover pubkey from it using sign_payload with ethereum personal_sign algo.",
56 Persona: "0x" + crypto.CompressedPubkeyHex(gh.Pubkey),
57 GithubUsername: gh.Identity,
58 SignPayload: gh.GenerateSignPayload(),
59 Signature: "%SIG_BASE64%",
60 CreatedAt: util.TimeToTimestampString(gh.CreatedAt),
61 Uuid: gh.Uuid.String(),
62 }
63
64 payload_json, _ := json.MarshalIndent(payload, "", "\t")
65 return map[string]string{"default": string(payload_json)}
66}
67
68func (gh *Github) GenerateSignPayload() (payload string) {
69 gh.Identity = strings.ToLower(gh.Identity)

Callers

nothing calls this directly

Calls 3

GenerateSignPayloadMethod · 0.95
CompressedPubkeyHexFunction · 0.92
TimeToTimestampStringFunction · 0.92

Tested by

no test coverage detected