{"action":"created","issue":{"url":"https://api.github.com/repos/hyperledger/fabric/issues/3","repository_url":"https://api.github.com/repos/hyperledger/fabric","labels_url":"https://api.github.com/repos/hyperledger/fabric/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/hyperledger/fabric/issues/3/comments","events_url":"https://api.github.com/repos/hyperledger/fabric/issues/3/events","html_url":"https://github.com/hyperledger/fabric/issues/3","id":145416417,"number":3,"title":"Chaincode should be addressed by a function of its code + initial parameters signature","user":{"login":"binhn","id":3342057,"avatar_url":"https://avatars.githubusercontent.com/u/3342057?v=3","gravatar_id":"","url":"https://api.github.com/users/binhn","html_url":"https://github.com/binhn","followers_url":"https://api.github.com/users/binhn/followers","following_url":"https://api.github.com/users/binhn/following{/other_user}","gists_url":"https://api.github.com/users/binhn/gists{/gist_id}","starred_url":"https://api.github.com/users/binhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binhn/subscriptions","organizations_url":"https://api.github.com/users/binhn/orgs","repos_url":"https://api.github.com/users/binhn/repos","events_url":"https://api.github.com/users/binhn/events{/privacy}","received_events_url":"https://api.github.com/users/binhn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hyperledger/fabric/labels/chaincode","name":"chaincode","color":"006b75"},{"url":"https://api.github.com/repos/hyperledger/fabric/labels/duplicate","name":"duplicate","color":"cccccc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2016-04-02T20:48:25Z","updated_at":"2016-04-02T20:48:32Z","closed_at":null,"body":"<a href=\"https://github.com/ghaskins\"><img src=\"https://avatars.githubusercontent.com/u/367132?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [ghaskins](https://github.com/ghaskins)**\n_Tuesday Dec 08, 2015 at 19:34 GMT_\n_Originally opened as https://github.com/openblockchain/obc-peer/issues/373_\n\n----\n\nIgnoring multi-signatory/escrow-contract scenarios, basic asset-move transactions in a blockchain could be described as a uni-lateral \"send\" function which may only be initiated by the sender (validated by digital signatures from key-pairs associated with the account).  Therefore, it is important to have confidence in the destination address' legitimacy as the intended target, as the asset-move will generally be irrevocable  once the transaction confirms.  Short of a compensating transaction at the behest of, and initiated by the destination chaincode, there is no function to revoke a mistake.  Specificity with the location/function of the destination is therefore important to gain both confidence in the network (an initiator may verify that an address resolves as they expect) as well as to catch mistakes/discrepancies (validators would only know how to route messages to the \"right\" code).  Fortunately, this should be fairly easy to capture by creating chaincode addresses as a hash of the actual code and initial parameters: address = f(code, initparams) -> hash([code, initparams]).   \n"},"comment":{"url":"https://api.github.com/repos/hyperledger/fabric/issues/comments/204802960","html_url":"https://github.com/hyperledger/fabric/issues/3#issuecomment-204802960","issue_url":"https://api.github.com/repos/hyperledger/fabric/issues/3","id":204802960,"user":{"login":"binhn","id":3342057,"avatar_url":"https://avatars.githubusercontent.com/u/3342057?v=3","gravatar_id":"","url":"https://api.github.com/users/binhn","html_url":"https://github.com/binhn","followers_url":"https://api.github.com/users/binhn/followers","following_url":"https://api.github.com/users/binhn/following{/other_user}","gists_url":"https://api.github.com/users/binhn/gists{/gist_id}","starred_url":"https://api.github.com/users/binhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binhn/subscriptions","organizations_url":"https://api.github.com/users/binhn/orgs","repos_url":"https://api.github.com/users/binhn/repos","events_url":"https://api.github.com/users/binhn/events{/privacy}","received_events_url":"https://api.github.com/users/binhn/received_events","type":"User","site_admin":false},"created_at":"2016-04-02T20:48:31Z","updated_at":"2016-04-02T20:48:31Z","body":"<a href=\"https://github.com/muralisrini\"><img src=\"https://avatars.githubusercontent.com/u/14361488?v=3\" align=\"left\" width=\"48\" height=\"48\" hspace=\"10\"></img></a> **Comment by [muralisrini](https://github.com/muralisrini)**\n_Monday Jan 04, 2016 at 19:24 GMT_\n\n----\n\nAfter discussions, hashcode == transaction id == chaincode-reference satisfies all needs without requiring a special version field.\r\n\r\nTo summarize \r\n  * hashcode is constructed from {path, func, args, codebytes-pointed-to-by-path}\r\n  * hashcode will also be the transaction id for deploy transactions\r\n  * invoke/query will use the hashcode (instead of {path, version})\r\n\r\nGiven hashcode is the transaction id, existing \"ledger.GetTransactionByUUID\" will retrieve the deploy transaction for the chaincode and can be used to build other queries. \r\n\r\n@prjayach pointed out that we could go one step further to maintain an index for saying hashes x1, x2, x3 are from the same path. This would provide the \"relationship\" between the chaincodes.\r\n\r\n@binhn, @frankyclu : re your desire to generalize \"relationship\" between chaincodes... there seems to be an opportunity here. What @prjayach is suggesting is a \"same-path\" relationship. Are relationships useful concepts to bubble all that way up so users can create relationships and bind chaincodes to them ?\n"}}