{"action":"created","comment":{"url":"https://api.github.com/repos/cosmos/gaia/pulls/comments/149458693","pull_request_review_id":74853932,"id":149458693,"diff_hunk":"@@ -0,0 +1,340 @@\n+# Staking Proposals\n+\n+This document is intended to lay out the implementation order of various\n+staking features. Each iteration of the staking module should be deployable \n+as a test-net. Please contribute to this document and add discussion :)\n+\n+Overall the Staking module should be rolled out in the following steps\n+\n+1. Self-Bonding\n+2. Delegation\n+3. Delegator Fees Piggy Bank\n+4. Unbonding period\n+5. Rewards, Commission\n+6. Delegator Rebonding\n+\n+## Self-Bonding\n+\n+The majority of the processing will happen from the set of all Validator Bonds\n+which is defined as an array and persisted in the application state.  Each\n+validator bond is defined as the object below. \n+ - Pubkey: Validator PubKey\n+ - Owner: Account which coins are bonded from and unbonded to\n+ - BondedTokens: Total number of bond tokens for the validator\n+ - VotingPower: Voting power in consensus\n+\n+``` golang\n+type ValidatorBonds []*ValidatorBond\n+\n+type ValidatorBond struct {\n+\tPubKey       crypto.PubKey \n+\tOwner        sdk.Actor    \n+\tBondedTokens uint64    \n+\tVotingPower  uint64   \n+}\n+```\n+Note that the Validator PubKey is not necessarily the PubKey of the sender of\n+the transaction, but is defined by the transaction. This way a separated key\n+can be used for holding tokens and participating in consensus. \n+\n+The VotingPower is proportional to the amount of bonded tokens which the validator\n+has if the validator is within the top 100 validators. At the launch of \n+cosmos hub we will have a maximum of 100 validators.\n+\n+TxBond is the self-bond SDK transaction for self-bonding tokens to a PubKey\n+which you designate.  Here the PubKey bytes are the serialized bytes of the\n+PubKey struct as defined by `tendermint/go-crypto`.\n+\n+``` golang\n+type TxBond struct {\n+\tPubKey crypto.PubKey \n+\tAmount coin.Coin     \n+}\n+```\n+\n+Similarity, `TxUnbond` can is used to unbond tokens from the validators bond\n+account. The key difference is from `TxBond` is that the PubKey does not need\n+to be included as it has already been associated with the sender account.\n+\n+\n+``` golang\n+type TxUnbond struct {\n+\tAmount coin.Coin `json:\"amount\"`\n+}\n+```\n+\n+## Delegation\n+\n+The next phase of development includes delegation functionality. All transactions\n+are still instantaneous in this development level.\n+\n+The previous struct `ValidatorBond` is now split up into two structs which represent\n+the candidate account or the bond to a candidate account.\n+\n+Each validator-candidate bond is defined as the object below. \n+ - Pubkey: Candidate PubKey\n+ - Owner: Account which coins are bonded from and unbonded to\n+ - Shares: Total number of shares issued by this candidate\n+ - VotingPower: Voting power in consensus\n+\n+``` golang\n+type Candidate struct {\n+\tPubKey       crypto.PubKey\n+\tOwner        sdk.Actor\n+\tShares       uint64    \n+\tVotingPower  uint64   \n+}\n+```\n+\n+At this phase in development the number of shares issued to each account \n+will be equal to the number of coins bonded to this candidate. In later phases\n+when staking reward is introduced, the shares will not be equal to the number \n+of coins bonded to the candidate. \n+\n+\n+DelegatorBond represents some bond tokens held by an account. It is owned by\n+one delegator, and is associated with the voting power of one delegatee.\n+\n+``` golang\n+type DelegatorBond struct {\n+\tPubKey crypto.PubKey\n+\tShares uint64\n+} \n+```\n+The sender of the transaction is considered to be the owner of the bond being\n+sent.  In this backend the client is expected to keep track of the list of\n+pubkeys which the delegator has delegated to. \n+\n+`TxBond` and `TxUnbond` can now be used with expanded functionality for use\n+from delegators. Now however `TxUnbond` must also include the PubKey which the\n+unbonding is to occur from. As such `TxBond` and `TxUnbond` can be consolidate. \n+\n+``` golang\n+type BondUpdate struct {\n+\tPubKey crypto.PubKey\n+\tAmount coin.Coin       \n+}\n+\n+type TxBond struct { BondUpdate }","path":"proposals/proposals.md","position":118,"original_position":118,"commit_id":"07e0cf6bd8b16d8d7c32226a02bb1c5383d2442e","original_commit_id":"07e0cf6bd8b16d8d7c32226a02bb1c5383d2442e","user":{"login":"ethanfrey","id":5689864,"avatar_url":"https://avatars3.githubusercontent.com/u/5689864?v=4","gravatar_id":"","url":"https://api.github.com/users/ethanfrey","html_url":"https://github.com/ethanfrey","followers_url":"https://api.github.com/users/ethanfrey/followers","following_url":"https://api.github.com/users/ethanfrey/following{/other_user}","gists_url":"https://api.github.com/users/ethanfrey/gists{/gist_id}","starred_url":"https://api.github.com/users/ethanfrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethanfrey/subscriptions","organizations_url":"https://api.github.com/users/ethanfrey/orgs","repos_url":"https://api.github.com/users/ethanfrey/repos","events_url":"https://api.github.com/users/ethanfrey/events{/privacy}","received_events_url":"https://api.github.com/users/ethanfrey/received_events","type":"User","site_admin":false},"body":"Please clarify the use of Amount in Bond/Unbond.\r\n\r\nIs this the delta (+amount or -amount)? Or is this the new amount?\r\n","created_at":"2017-11-07T18:19:49Z","updated_at":"2017-11-07T19:02:09Z","html_url":"https://github.com/cosmos/gaia/pull/33#discussion_r149458693","pull_request_url":"https://api.github.com/repos/cosmos/gaia/pulls/33","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/cosmos/gaia/pulls/comments/149458693"},"html":{"href":"https://github.com/cosmos/gaia/pull/33#discussion_r149458693"},"pull_request":{"href":"https://api.github.com/repos/cosmos/gaia/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/cosmos/gaia/pulls/33","id":148095503,"html_url":"https://github.com/cosmos/gaia/pull/33","diff_url":"https://github.com/cosmos/gaia/pull/33.diff","patch_url":"https://github.com/cosmos/gaia/pull/33.patch","issue_url":"https://api.github.com/repos/cosmos/gaia/issues/33","number":33,"state":"open","locked":false,"title":"WIP: proposals","user":{"login":"rigelrozanski","id":20132176,"avatar_url":"https://avatars1.githubusercontent.com/u/20132176?v=4","gravatar_id":"","url":"https://api.github.com/users/rigelrozanski","html_url":"https://github.com/rigelrozanski","followers_url":"https://api.github.com/users/rigelrozanski/followers","following_url":"https://api.github.com/users/rigelrozanski/following{/other_user}","gists_url":"https://api.github.com/users/rigelrozanski/gists{/gist_id}","starred_url":"https://api.github.com/users/rigelrozanski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rigelrozanski/subscriptions","organizations_url":"https://api.github.com/users/rigelrozanski/orgs","repos_url":"https://api.github.com/users/rigelrozanski/repos","events_url":"https://api.github.com/users/rigelrozanski/events{/privacy}","received_events_url":"https://api.github.com/users/rigelrozanski/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-10-23T10:40:16Z","updated_at":"2017-11-07T19:02:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50d1153688308fa5facb0c0977cf353cc519eb94","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ebuchman","id":2300911,"avatar_url":"https://avatars3.githubusercontent.com/u/2300911?v=4","gravatar_id":"","url":"https://api.github.com/users/ebuchman","html_url":"https://github.com/ebuchman","followers_url":"https://api.github.com/users/ebuchman/followers","following_url":"https://api.github.com/users/ebuchman/following{/other_user}","gists_url":"https://api.github.com/users/ebuchman/gists{/gist_id}","starred_url":"https://api.github.com/users/ebuchman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebuchman/subscriptions","organizations_url":"https://api.github.com/users/ebuchman/orgs","repos_url":"https://api.github.com/users/ebuchman/repos","events_url":"https://api.github.com/users/ebuchman/events{/privacy}","received_events_url":"https://api.github.com/users/ebuchman/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/cosmos/gaia/pulls/33/commits","review_comments_url":"https://api.github.com/repos/cosmos/gaia/pulls/33/comments","review_comment_url":"https://api.github.com/repos/cosmos/gaia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cosmos/gaia/issues/33/comments","statuses_url":"https://api.github.com/repos/cosmos/gaia/statuses/07e0cf6bd8b16d8d7c32226a02bb1c5383d2442e","head":{"label":"cosmos:proposals","ref":"proposals","sha":"07e0cf6bd8b16d8d7c32226a02bb1c5383d2442e","user":{"login":"cosmos","id":228843,"avatar_url":"https://avatars0.githubusercontent.com/u/228843?v=4","gravatar_id":"","url":"https://api.github.com/users/cosmos","html_url":"https://github.com/cosmos","followers_url":"https://api.github.com/users/cosmos/followers","following_url":"https://api.github.com/users/cosmos/following{/other_user}","gists_url":"https://api.github.com/users/cosmos/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmos/subscriptions","organizations_url":"https://api.github.com/users/cosmos/orgs","repos_url":"https://api.github.com/users/cosmos/repos","events_url":"https://api.github.com/users/cosmos/events{/privacy}","received_events_url":"https://api.github.com/users/cosmos/received_events","type":"Organization","site_admin":false},"repo":{"id":94568655,"name":"gaia","full_name":"cosmos/gaia","owner":{"login":"cosmos","id":228843,"avatar_url":"https://avatars0.githubusercontent.com/u/228843?v=4","gravatar_id":"","url":"https://api.github.com/users/cosmos","html_url":"https://github.com/cosmos","followers_url":"https://api.github.com/users/cosmos/followers","following_url":"https://api.github.com/users/cosmos/following{/other_user}","gists_url":"https://api.github.com/users/cosmos/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmos/subscriptions","organizations_url":"https://api.github.com/users/cosmos/orgs","repos_url":"https://api.github.com/users/cosmos/repos","events_url":"https://api.github.com/users/cosmos/events{/privacy}","received_events_url":"https://api.github.com/users/cosmos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cosmos/gaia","description":"Cosmos Gaia chain (pre-genesis)","fork":false,"url":"https://api.github.com/repos/cosmos/gaia","forks_url":"https://api.github.com/repos/cosmos/gaia/forks","keys_url":"https://api.github.com/repos/cosmos/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cosmos/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cosmos/gaia/teams","hooks_url":"https://api.github.com/repos/cosmos/gaia/hooks","issue_events_url":"https://api.github.com/repos/cosmos/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/cosmos/gaia/events","assignees_url":"https://api.github.com/repos/cosmos/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/cosmos/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/cosmos/gaia/tags","blobs_url":"https://api.github.com/repos/cosmos/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cosmos/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cosmos/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/cosmos/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cosmos/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/cosmos/gaia/languages","stargazers_url":"https://api.github.com/repos/cosmos/gaia/stargazers","contributors_url":"https://api.github.com/repos/cosmos/gaia/contributors","subscribers_url":"https://api.github.com/repos/cosmos/gaia/subscribers","subscription_url":"https://api.github.com/repos/cosmos/gaia/subscription","commits_url":"https://api.github.com/repos/cosmos/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/cosmos/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/cosmos/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/cosmos/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/cosmos/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/cosmos/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cosmos/gaia/merges","archive_url":"https://api.github.com/repos/cosmos/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cosmos/gaia/downloads","issues_url":"https://api.github.com/repos/cosmos/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/cosmos/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/cosmos/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/cosmos/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cosmos/gaia/labels{/name}","releases_url":"https://api.github.com/repos/cosmos/gaia/releases{/id}","deployments_url":"https://api.github.com/repos/cosmos/gaia/deployments","created_at":"2017-06-16T17:53:14Z","updated_at":"2017-11-07T17:51:48Z","pushed_at":"2017-11-07T18:03:47Z","git_url":"git://github.com/cosmos/gaia.git","ssh_url":"git@github.com:cosmos/gaia.git","clone_url":"https://github.com/cosmos/gaia.git","svn_url":"https://github.com/cosmos/gaia","homepage":null,"size":268,"stargazers_count":12,"watchers_count":12,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":27,"forks":8,"open_issues":27,"watchers":12,"default_branch":"master"}},"base":{"label":"cosmos:master","ref":"master","sha":"6a512d835334091b205bc4bc215fd4bf0402e795","user":{"login":"cosmos","id":228843,"avatar_url":"https://avatars0.githubusercontent.com/u/228843?v=4","gravatar_id":"","url":"https://api.github.com/users/cosmos","html_url":"https://github.com/cosmos","followers_url":"https://api.github.com/users/cosmos/followers","following_url":"https://api.github.com/users/cosmos/following{/other_user}","gists_url":"https://api.github.com/users/cosmos/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmos/subscriptions","organizations_url":"https://api.github.com/users/cosmos/orgs","repos_url":"https://api.github.com/users/cosmos/repos","events_url":"https://api.github.com/users/cosmos/events{/privacy}","received_events_url":"https://api.github.com/users/cosmos/received_events","type":"Organization","site_admin":false},"repo":{"id":94568655,"name":"gaia","full_name":"cosmos/gaia","owner":{"login":"cosmos","id":228843,"avatar_url":"https://avatars0.githubusercontent.com/u/228843?v=4","gravatar_id":"","url":"https://api.github.com/users/cosmos","html_url":"https://github.com/cosmos","followers_url":"https://api.github.com/users/cosmos/followers","following_url":"https://api.github.com/users/cosmos/following{/other_user}","gists_url":"https://api.github.com/users/cosmos/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmos/subscriptions","organizations_url":"https://api.github.com/users/cosmos/orgs","repos_url":"https://api.github.com/users/cosmos/repos","events_url":"https://api.github.com/users/cosmos/events{/privacy}","received_events_url":"https://api.github.com/users/cosmos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cosmos/gaia","description":"Cosmos Gaia chain (pre-genesis)","fork":false,"url":"https://api.github.com/repos/cosmos/gaia","forks_url":"https://api.github.com/repos/cosmos/gaia/forks","keys_url":"https://api.github.com/repos/cosmos/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cosmos/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cosmos/gaia/teams","hooks_url":"https://api.github.com/repos/cosmos/gaia/hooks","issue_events_url":"https://api.github.com/repos/cosmos/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/cosmos/gaia/events","assignees_url":"https://api.github.com/repos/cosmos/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/cosmos/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/cosmos/gaia/tags","blobs_url":"https://api.github.com/repos/cosmos/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cosmos/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cosmos/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/cosmos/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cosmos/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/cosmos/gaia/languages","stargazers_url":"https://api.github.com/repos/cosmos/gaia/stargazers","contributors_url":"https://api.github.com/repos/cosmos/gaia/contributors","subscribers_url":"https://api.github.com/repos/cosmos/gaia/subscribers","subscription_url":"https://api.github.com/repos/cosmos/gaia/subscription","commits_url":"https://api.github.com/repos/cosmos/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/cosmos/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/cosmos/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/cosmos/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/cosmos/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/cosmos/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cosmos/gaia/merges","archive_url":"https://api.github.com/repos/cosmos/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cosmos/gaia/downloads","issues_url":"https://api.github.com/repos/cosmos/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/cosmos/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/cosmos/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/cosmos/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cosmos/gaia/labels{/name}","releases_url":"https://api.github.com/repos/cosmos/gaia/releases{/id}","deployments_url":"https://api.github.com/repos/cosmos/gaia/deployments","created_at":"2017-06-16T17:53:14Z","updated_at":"2017-11-07T17:51:48Z","pushed_at":"2017-11-07T18:03:47Z","git_url":"git://github.com/cosmos/gaia.git","ssh_url":"git@github.com:cosmos/gaia.git","clone_url":"https://github.com/cosmos/gaia.git","svn_url":"https://github.com/cosmos/gaia","homepage":null,"size":268,"stargazers_count":12,"watchers_count":12,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":27,"forks":8,"open_issues":27,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cosmos/gaia/pulls/33"},"html":{"href":"https://github.com/cosmos/gaia/pull/33"},"issue":{"href":"https://api.github.com/repos/cosmos/gaia/issues/33"},"comments":{"href":"https://api.github.com/repos/cosmos/gaia/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/cosmos/gaia/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/cosmos/gaia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cosmos/gaia/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/cosmos/gaia/statuses/07e0cf6bd8b16d8d7c32226a02bb1c5383d2442e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ethanfrey"}}