You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proof of ownership is a message, signed by the node, that can be used by a client to prove node ownership. For instance can be used as a way to authenticate to the node and perform administrative tasks, such as requesting a change of the node private/public key.
This message is returned by an api call consumed by the client (/noderegistration/getproofofownership).
validate that signature on the proof is valid for the provided node public key
validate that the height is not more than X blocks older than the current block height
look up block in the db where height = the height in the proof of ownership message, and verify the block hash in the proof also matches
implement grpc api for the client to consume the proof of ownership request:
api endpoint: /nodeadmin/getProofOfOwnership
request body:
signature ([]byte)
response data
accountType (uint32): account type
accountAddress (string): account address
blockHash ([]byte): last block hash
blockHeight (uint32): height of last block hash
signature ([]bytes): signature of all the above fields (with node's private key)
business logic:
validate request by verifying the 'signature' field is been signed using the node owner's account address (for now we don't have it and this data can be mocked just not to break the data flow. in future the node, after installation, should already contain a owner's account address, together with a default node private key)
if request is valid:
call Generate Proof of Ownership function, that should return the message described above as 'response data'
* #80 add core node admin services
* improve generate proof of ownership function
* on progress proof of ownership validation
* node message conversion from byte
* add nodeAdminCoreService test
* add config owner acc address
* recompiled schema after refactoring ProofOfOwnership protobuf
Refactored signature.go: changed method name from SignBlock to SignByNode (to generalise message that are signed using node pri key)
Added GetBlockHash to blockUtil.go
Refactored nodeAdminCoreService.GenerateProofOfOwnership: now reusing methods from other service and packages to reduce duplication of business logic
added helpers interface and injected into NodeAdmin stuct to make its methods mockable
refactored unit test for GenerateProofOfOwnership
* added GetBlockByHeight to blockService and creted unit test
refactored ValidateProofOfOwnership method to reuse already (previously) implemented methods
* finished refactoring ValidateProofOfOwnership
moved all helper (mockable) methods to NodeAdminServiceHelpersInterface
fixed bug in GetSize for accountType (min size in bytes for an integer in protobuf v3 is 4, so we cannot have 2 or 1 byte fields)
* fixed loading config params: using configuration already loaded in main.go
fixed relative unit tests
* injected BlockService into NodeAdminService to make it mockable and refactored relative code/tests
* simplified unit tests by removing unecessary mocked queries (since now we mock direclty the blockservice, which is the one where queries needed to be mocked)
Description
Proof of ownership is a message, signed by the node, that can be used by a client to prove node ownership. For instance can be used as a way to authenticate to the node and perform administrative tasks, such as requesting a change of the node private/public key.
This message is returned by an api call consumed by the client (/noderegistration/getproofofownership).
See https://docs.google.com/document/d/118CdR0WOIpZx4C9Hnx-JsrHz3vXn9OZ6eMokk9y71hk/edit#bookmark=id.f379wvfhj4m5 for details
Breakdown
Additional Diagram / File
See https://docs.google.com/document/d/118CdR0WOIpZx4C9Hnx-JsrHz3vXn9OZ6eMokk9y71hk/edit#bookmark=id.f379wvfhj4m5 for details
References
#68
The text was updated successfully, but these errors were encountered: