From 358cae89646186be47c33f54d86c3b36e4aabc98 Mon Sep 17 00:00:00 2001 From: BiPhan4 Date: Wed, 30 Nov 2022 14:43:20 -0500 Subject: [PATCH 1/8] filetree readMe started. Committing to check formatting --- x/filetree/README.md | 56 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/x/filetree/README.md b/x/filetree/README.md index 5c042610d..8e3e57448 100644 --- a/x/filetree/README.md +++ b/x/filetree/README.md @@ -10,9 +10,13 @@ parent: ## Contents 1. [Concept](#concept) -2. [Client](#client) +2. [Merkle Paths](#merkle-paths) +3. [Client](#client) + [Query](#query) + [Transactions](#transactions) +4. [Transaction Messages](#transaction-messages) + + [Postkey](#postkey) + ## Concept @@ -65,6 +69,8 @@ func checkChild(parent ps, child cs, hc H(child)) { ## Client + +Below are CLI query and transaction commands to interact with canined. ### Query The `query` commands allow users to query `filetree` state. ```sh @@ -76,3 +82,51 @@ The `tx` commands allow users to interact with the `filetree` module. ```sh canined tx filetree --help ``` + +## Transaction Messages + +Below is a full description of valid transaction messages that can be broadcasted to affect state change. These descriptions aim to be "implementation agnostic", i.e., they make sense to both the CLI/Golang and TS implementation. + +### Postkey + +|Name|Type|Description| +|--|--|--| +|creator | String | The creator and broadcaster of this message. Pass in +Bech32 address + +|key | String | ecies.PublicKey + +#### Response + +Coming soon + +### Makeroot + +Create an absolute root folder for a storage account. + +|Name|Type|Description| +|--|--|--| +|creator | String | The creator and broadcaster of this message. Pass in +Bech32 address + +|account | String | Hex[ hash( bech32 address of user that will own this account)]. + +Please note that the broadcaster of this message will always be making a storage account for themselves, but there are other filetree transaction messages that can be called by userA to affect a change in userB's account. It is for this purpose that the Account field exists. + +|rootHashPath | String | MerklePath("s") + +|contents | String | "Place holder contents." Do NOT pass in an empty string + +|editors | String | string(json encoded map) with: + +let c = concatenate( "e", trackingNumber, bech32 address ) +map key: hex[ hash("c") ] +map value: ECIES.encrypt( aesIV + aesKey ) + +|viewers | String | Pass in "NONE" Do not pass in an emptry string else message validation will fail. sRoot folder has no viewers. Unknown at this time if this field will be needed in the future so we leave it in for now. + +|trackingNumber | String | UUID. This trackingNumber is one and the same as what is used in editors map + +#### Response + +Coming soon \ No newline at end of file From d08e4d0fe07e64bc2517392e50b7e12a1a25dc37 Mon Sep 17 00:00:00 2001 From: BiPhan4 Date: Wed, 30 Nov 2022 14:47:12 -0500 Subject: [PATCH 2/8] fix readMe formatting --- x/filetree/README.md | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/x/filetree/README.md b/x/filetree/README.md index 8e3e57448..92d7193b3 100644 --- a/x/filetree/README.md +++ b/x/filetree/README.md @@ -91,9 +91,7 @@ Below is a full description of valid transaction messages that can be broadcaste |Name|Type|Description| |--|--|--| -|creator | String | The creator and broadcaster of this message. Pass in -Bech32 address - +|creator | String | The creator and broadcaster of this message. Pass in Bech32 address |key | String | ecies.PublicKey #### Response @@ -106,25 +104,12 @@ Create an absolute root folder for a storage account. |Name|Type|Description| |--|--|--| -|creator | String | The creator and broadcaster of this message. Pass in -Bech32 address - -|account | String | Hex[ hash( bech32 address of user that will own this account)]. - -Please note that the broadcaster of this message will always be making a storage account for themselves, but there are other filetree transaction messages that can be called by userA to affect a change in userB's account. It is for this purpose that the Account field exists. - +|creator | String | The creator and broadcaster of this message. Pass in Bech32 address +|account | String | Hex[ hash( bech32 address of user that will own this account)]. Please note that the broadcaster of this message will always be making a storage account for themselves, but there are other filetree transaction messages that can be called by userA to affect a change in userB's account. It is for this purpose that the Account field exists. |rootHashPath | String | MerklePath("s") - |contents | String | "Place holder contents." Do NOT pass in an empty string - -|editors | String | string(json encoded map) with: - -let c = concatenate( "e", trackingNumber, bech32 address ) -map key: hex[ hash("c") ] -map value: ECIES.encrypt( aesIV + aesKey ) - -|viewers | String | Pass in "NONE" Do not pass in an emptry string else message validation will fail. sRoot folder has no viewers. Unknown at this time if this field will be needed in the future so we leave it in for now. - +|editors | String | string(json encoded map) with: let c = concatenate( "e", trackingNumber, bech32 address ) map. key: hex[ hash("c") ]. map value: ECIES.encrypt( aesIV + aesKey ) +|viewers | String | Pass in "NONE" Do not pass in an emptry string else message validation will fail. Root folder has no viewers. Unknown at this time if this field will be needed in the future so we leave it in for now. |trackingNumber | String | UUID. This trackingNumber is one and the same as what is used in editors map #### Response From 2a4796b84156d2a31f912ab1147e8a2ff40a65c7 Mon Sep 17 00:00:00 2001 From: BiPhan4 Date: Wed, 30 Nov 2022 14:59:20 -0500 Subject: [PATCH 3/8] adding line breaks --- x/filetree/README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/x/filetree/README.md b/x/filetree/README.md index 92d7193b3..2614a4c2f 100644 --- a/x/filetree/README.md +++ b/x/filetree/README.md @@ -102,14 +102,32 @@ Coming soon Create an absolute root folder for a storage account. +|Name|Type|Description| +|--|--|--| +|creator | String | The creator and broadcaster of this message. Pass in Bech32 address +|account | String | Hex[ hash( bech32 address of user that will own this account)]. Please note that the broadcaster of this message will always be making a storage account for themselves, but there are other filetree transaction messages that can be called by userA to affect a change in userB's account.
It is for this purpose that the Account field exists. +|rootHashPath | String | MerklePath("s") +|contents | String | "Place holder contents." Do NOT pass in an empty string +|editors | String | string(json encoded map) with:
let c = concatenate( "e", trackingNumber, bech32 address ) map_key: hex[ hash("c") ]. map_value: ECIES.encrypt( aesIV + aesKey ) +|viewers | String | Pass in "NONE." Do not pass in an emptry string else message validation will fail. Root folder has no viewers. Unknown at this time if this field will be needed in the future so we leave it in for now. +|trackingNumber | String | UUID. This trackingNumber is one and the same as what is used in editors map + +#### Response + +Coming soon + +### Postfile + +Create an absolute root folder for a storage account. + |Name|Type|Description| |--|--|--| |creator | String | The creator and broadcaster of this message. Pass in Bech32 address |account | String | Hex[ hash( bech32 address of user that will own this account)]. Please note that the broadcaster of this message will always be making a storage account for themselves, but there are other filetree transaction messages that can be called by userA to affect a change in userB's account. It is for this purpose that the Account field exists. |rootHashPath | String | MerklePath("s") |contents | String | "Place holder contents." Do NOT pass in an empty string -|editors | String | string(json encoded map) with: let c = concatenate( "e", trackingNumber, bech32 address ) map. key: hex[ hash("c") ]. map value: ECIES.encrypt( aesIV + aesKey ) -|viewers | String | Pass in "NONE" Do not pass in an emptry string else message validation will fail. Root folder has no viewers. Unknown at this time if this field will be needed in the future so we leave it in for now. +|editors | String | string(json encoded map) with: let c = concatenate( "e", trackingNumber, bech32 address ) map_key: hex[ hash("c") ]. map_value: ECIES.encrypt( aesIV + aesKey ) +|viewers | String | Pass in "NONE." Do not pass in an emptry string else message validation will fail. Root folder has no viewers. Unknown at this time if this field will be needed in the future so we leave it in for now. |trackingNumber | String | UUID. This trackingNumber is one and the same as what is used in editors map #### Response From 5d51ca25e9115e5547a0ebd343da7763d52a01c4 Mon Sep 17 00:00:00 2001 From: BiPhan4 Date: Wed, 30 Nov 2022 17:16:28 -0500 Subject: [PATCH 4/8] saving so I can work on other branch --- x/filetree/README.md | 77 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 17 deletions(-) diff --git a/x/filetree/README.md b/x/filetree/README.md index 2614a4c2f..a5d16816f 100644 --- a/x/filetree/README.md +++ b/x/filetree/README.md @@ -85,10 +85,12 @@ canined tx filetree --help ## Transaction Messages -Below is a full description of valid transaction messages that can be broadcasted to affect state change. These descriptions aim to be "implementation agnostic", i.e., they make sense to both the CLI/Golang and TS implementation. +Below is a full description of valid transaction messages that can be broadcasted to affect state change. These descriptions aim to be "implementation agnostic", i.e., they make sense to both the CLI/Golang and TS implementations. ### Postkey +Post a ecies.PublicKey on chain for the encryption scheme + |Name|Type|Description| |--|--|--| |creator | String | The creator and broadcaster of this message. Pass in Bech32 address @@ -104,32 +106,73 @@ Create an absolute root folder for a storage account. |Name|Type|Description| |--|--|--| -|creator | String | The creator and broadcaster of this message. Pass in Bech32 address -|account | String | Hex[ hash( bech32 address of user that will own this account)]. Please note that the broadcaster of this message will always be making a storage account for themselves, but there are other filetree transaction messages that can be called by userA to affect a change in userB's account.
It is for this purpose that the Account field exists. -|rootHashPath | String | MerklePath("s") -|contents | String | "Place holder contents." Do NOT pass in an empty string -|editors | String | string(json encoded map) with:
let c = concatenate( "e", trackingNumber, bech32 address ) map_key: hex[ hash("c") ]. map_value: ECIES.encrypt( aesIV + aesKey ) -|viewers | String | Pass in "NONE." Do not pass in an emptry string else message validation will fail. Root folder has no viewers. Unknown at this time if this field will be needed in the future so we leave it in for now. +|creator | String | The creator and broadcaster of this message. Pass in Bech32 address
+|account | String | Hex[ hash( Bech32 address of user that will own this account)].
Please note that the broadcaster of this message will always be making a storage account for themselves, but there are other filetree transaction messages that can be called by userA to affect a change in userB's account. It is for this purpose that the Account field exists.
+|rootHashPath | String | MerklePath("s")
+|contents | String | "Place holder contents." Do NOT pass in an empty string
+|editors | String | string(json encoded map) with:
let c = concatenate( "e", trackingNumber, Bech32 address )
map_key: hex[ hash("c") ]
map_value: ECIES.encrypt( aesIV + aesKey )
+|viewers | String | Pass in "NONE." Do not pass in an emptry string else message validation will fail. Root folder has no viewers. Unknown at this time if this field will be needed in the future so we leave it in for now.
|trackingNumber | String | UUID. This trackingNumber is one and the same as what is used in editors map #### Response Coming soon -### Postfile +### PostFile -Create an absolute root folder for a storage account. +Create and save a new 'Files' struct on chain. The distinction between a folder and a file is very clear in jackalJS, but the filetree module does not care whether a Files struct is being used to save data for a folder or a file. + +Let it be that alice wants to create a home folder |Name|Type|Description| |--|--|--| -|creator | String | The creator and broadcaster of this message. Pass in Bech32 address -|account | String | Hex[ hash( bech32 address of user that will own this account)]. Please note that the broadcaster of this message will always be making a storage account for themselves, but there are other filetree transaction messages that can be called by userA to affect a change in userB's account. It is for this purpose that the Account field exists. -|rootHashPath | String | MerklePath("s") -|contents | String | "Place holder contents." Do NOT pass in an empty string -|editors | String | string(json encoded map) with: let c = concatenate( "e", trackingNumber, bech32 address ) map_key: hex[ hash("c") ]. map_value: ECIES.encrypt( aesIV + aesKey ) -|viewers | String | Pass in "NONE." Do not pass in an emptry string else message validation will fail. Root folder has no viewers. Unknown at this time if this field will be needed in the future so we leave it in for now. -|trackingNumber | String | UUID. This trackingNumber is one and the same as what is used in editors map +|creator | String | The creator and broadcaster of this message. Pass in alice's Bech32 address
+|account | String | Hex[ hash( alice's Bech32 address )]
+|hashparent | String | MerklePath("s")
+|hashchild | String | Hex[ hash("home") ]
+|contents | String | FID
+|viewers | String | string(json encoded map) with:
let c = concatenate( "v", trackingNumber, Bech32 address )
map_key: hex[ hash("c") ]
map_value: ECIES.encrypt( aesIV + aesKey )
+|editors | String | same as above but with c = concatenate( "e", trackingNumber, Bech32 address )
+|trackingNumber | String | UUID. This trackingNumber is one and the same as what is used in editors AND viewers map
+ +alice can add other users to her viewers and editors map aswell. +#### Response + +let fullMerklePath = MerklePath("s/home") + +```json +{ + + "path": "fullMerklePath" + +} +``` +### Delete + +Let it be that alice wants to delete her "s/home" folder + +|Name|Type|Description| +|--|--|--| +|creator | String | The creator and broadcaster of this message. Pass in alice's Bech32 address
+|hashPath | String | MerklePath("s/home")
+|account | String | Hex[ hash( alice's Bech32 address )]
+ +#### Response + +Coming soon + +## Query Requests + +Below is a full description of valid query requests that can be made to retrieve state information. These descriptions aim to be "implementation agnostic", i.e., they make sense to both the CLI/Golang and TS implementations. + +### QueryGetPubkeyRequest + +Retrieve a user's ecies.PublicKey + +|Name|Type|Description| +|--|--|--| +|Address | String | user's Bech32 address
#### Response -Coming soon \ No newline at end of file +types.PubKey From f1bcca7bada11a32caaea6633734de8d7f49a61c Mon Sep 17 00:00:00 2001 From: BiPhan4 Date: Fri, 2 Dec 2022 14:02:26 -0500 Subject: [PATCH 5/8] clean up readMe --- x/filetree/README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/x/filetree/README.md b/x/filetree/README.md index a5d16816f..052730c73 100644 --- a/x/filetree/README.md +++ b/x/filetree/README.md @@ -16,6 +16,15 @@ parent: + [Transactions](#transactions) 4. [Transaction Messages](#transaction-messages) + [Postkey](#postkey) + + [Makeroot](#makeroot) + + [Postfile](#postfile) + + [Delete](#delete) +5. [Query Requests](#query-requests) + + [GetPubkey](#getpubkey) + + [GetFiles](#getfiles) + + + @@ -165,7 +174,7 @@ Coming soon Below is a full description of valid query requests that can be made to retrieve state information. These descriptions aim to be "implementation agnostic", i.e., they make sense to both the CLI/Golang and TS implementations. -### QueryGetPubkeyRequest +### GetPubkey Retrieve a user's ecies.PublicKey @@ -176,3 +185,19 @@ Retrieve a user's ecies.PublicKey #### Response types.PubKey + +### GetFiles + +Retrieve a Files struct. Let it be that alice want's to retrieve "s/home/bunny.jpg" + +|Name|Type|Description| +|--|--|--| +|Address | String | MerklePath("s/home/bunny.jpg")
+|OwnerAddress | String | accountHash = Hex[hash(alice's bech32 address)]
let c = concatenate("o", MerklePath("s/home/bunny.jpg"), accountHash)
OwnerAddress = hex[hash(c)]
+ + +#### Response + +types.Files + + From 7744dee1b34640c184545116872ac6a7cc7a119f Mon Sep 17 00:00:00 2001 From: BiPhan4 Date: Fri, 2 Dec 2022 16:35:13 -0500 Subject: [PATCH 6/8] minor readMe edit --- x/filetree/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/filetree/README.md b/x/filetree/README.md index 052730c73..8fce39ce7 100644 --- a/x/filetree/README.md +++ b/x/filetree/README.md @@ -118,7 +118,7 @@ Create an absolute root folder for a storage account. |creator | String | The creator and broadcaster of this message. Pass in Bech32 address
|account | String | Hex[ hash( Bech32 address of user that will own this account)].
Please note that the broadcaster of this message will always be making a storage account for themselves, but there are other filetree transaction messages that can be called by userA to affect a change in userB's account. It is for this purpose that the Account field exists.
|rootHashPath | String | MerklePath("s")
-|contents | String | "Place holder contents." Do NOT pass in an empty string
+|contents | String | FID
|editors | String | string(json encoded map) with:
let c = concatenate( "e", trackingNumber, Bech32 address )
map_key: hex[ hash("c") ]
map_value: ECIES.encrypt( aesIV + aesKey )
|viewers | String | Pass in "NONE." Do not pass in an emptry string else message validation will fail. Root folder has no viewers. Unknown at this time if this field will be needed in the future so we leave it in for now.
|trackingNumber | String | UUID. This trackingNumber is one and the same as what is used in editors map From fbf9d58741cc28d78ba8b8e768f9f0dfcf2bdcd7 Mon Sep 17 00:00:00 2001 From: BiPhan4 Date: Mon, 5 Dec 2022 13:41:14 -0500 Subject: [PATCH 7/8] minor change to readMe --- x/filetree/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/filetree/README.md b/x/filetree/README.md index 8fce39ce7..c3f8e5b0a 100644 --- a/x/filetree/README.md +++ b/x/filetree/README.md @@ -180,7 +180,7 @@ Retrieve a user's ecies.PublicKey |Name|Type|Description| |--|--|--| -|Address | String | user's Bech32 address
+|address | String | user's Bech32 address
#### Response @@ -192,8 +192,8 @@ Retrieve a Files struct. Let it be that alice want's to retrieve "s/home/bunny.j |Name|Type|Description| |--|--|--| -|Address | String | MerklePath("s/home/bunny.jpg")
-|OwnerAddress | String | accountHash = Hex[hash(alice's bech32 address)]
let c = concatenate("o", MerklePath("s/home/bunny.jpg"), accountHash)
OwnerAddress = hex[hash(c)]
+|address | String | MerklePath("s/home/bunny.jpg")
+|ownerAddress | String | accountHash = Hex[hash(alice's bech32 address)]
let c = concatenate("o", MerklePath("s/home/bunny.jpg"), accountHash)
OwnerAddress = hex[hash(c)]
#### Response From c2cbd898e0c75b9d26571bc2c359e137b07a1b36 Mon Sep 17 00:00:00 2001 From: BiPhan4 Date: Mon, 5 Dec 2022 16:40:40 -0500 Subject: [PATCH 8/8] minor readMe update --- x/filetree/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/filetree/README.md b/x/filetree/README.md index c3f8e5b0a..6ce2f5f6e 100644 --- a/x/filetree/README.md +++ b/x/filetree/README.md @@ -137,8 +137,8 @@ Let it be that alice wants to create a home folder |--|--|--| |creator | String | The creator and broadcaster of this message. Pass in alice's Bech32 address
|account | String | Hex[ hash( alice's Bech32 address )]
-|hashparent | String | MerklePath("s")
-|hashchild | String | Hex[ hash("home") ]
+|hashParent | String | MerklePath("s")
+|hashChild | String | Hex[ hash("home") ]
|contents | String | FID
|viewers | String | string(json encoded map) with:
let c = concatenate( "v", trackingNumber, Bech32 address )
map_key: hex[ hash("c") ]
map_value: ECIES.encrypt( aesIV + aesKey )
|editors | String | same as above but with c = concatenate( "e", trackingNumber, Bech32 address )