Conversation
|
Please specify initially supported hash algorithms |
|
Suggestions as to what that limit should be? I can increase the variable size, if needed. I think 65K is plenty big for now. If people desire to use big stuff for preimages (i.e. real images) it could be changed later. My guess is most will use random gobldygook generated by their software. |
|
I think we'd better implement bitshares/bitshares-core#167 before adding new parameters to global parameters (which needs a new BSIP as well), although it's possible to add new parameters now via extensions (see cryptonomex/graphene#612). Probably we can port some code from YOYOW. |
|
I went ahead and added some limits, just to see what you think. The BSIP still says that the committee should set the max timeout and max preimage size. So we need to pick hardcode vs. committee. I agree that bitshares/bitshares-core/#167 should be implemented. I would rather do that than shoe-horn in a parameter via an extension. So, I am looking for suggestions:
|
|
IMO it makes little sense to use a preimage that is longer than the hash size. I'd suggest a default maximum of 1024 bytes. Maybe even less. I think HTLC is more imporant than bitshares/bitshares-core#167, so we shouldn't create a dependency there. Still, the parameter should be a chain_parameter right from the start. I think adding the extension would be the best option. |
All that makes sense. My desire to not do things twice was greater than what is logical. Updated spec to eliminate the hard-coding and went back to committee flexibility. |
| asset pending_fee; | ||
| vector<unsigned char> preimage_hash; | ||
| fc::enum_type<uint8_t, hash_algorithm> preimage_hash_algorithm; | ||
| htlc_hash preimage_hash; |
There was a problem hiding this comment.
need to define htlc_hash type if you mention it here
bsip-0044.md
Outdated
| Set: `contract.preimage_length` = `preimage_length` | ||
| Set: `contract.timeout_treshold` = `timeout_threshold` | ||
| Transfer: from `depositor` account to `contract.quantity` of `contract.symbol` | ||
| Transfer: remove `contract.quantity` of `contract.symbol` from from` account |
There was a problem hiding this comment.
Missing backtick before second "from"
bsip-0044.md
Outdated
| }; | ||
| ``` | ||
|
|
||
| Note 1: The preimage hash algorithm must be speceified as either ``SHA256``, ``RIPEMD160``, or ``SHA1``. The use of ``SHA1`` is added for compatibility to other chains, but its use is discouraged. |
There was a problem hiding this comment.
This note is no longer applicable.
|
Generally, I think BSIPs should not be modified after approval. Modifying implementation details is probably ok to prevent future confusion. This PR contains a little more than just "grammar fixes" and implementation details. I think these additional changes do not modify the original intent and are therefore probably ok too. |
bsip-0044.md
Outdated
| typedef fc::static_variant< | ||
| htlc_algo_ripemd160, | ||
| htlc_algo_sha1, | ||
| htlc_algo_sha256 |
There was a problem hiding this comment.
Now you should mention what these three new types are... :-)
There was a problem hiding this comment.
Do you think it best to put it in a descriptive note below this section or a //comment on each line? I'll give //comment a try.
pmconrad
left a comment
There was a problem hiding this comment.
Ok for me.
Would like a second opinion though. @sschiessl-bcp perhaps?
ryanRfox
left a comment
There was a problem hiding this comment.
Thank you @jmjatlanta for making all the changes requested by @abitmore and @pmconrad . This PR is ready for merge.
This PR fixes a few "bugs" in the HTLC BSIP.
Comments from @abitmore that require more discussion:
#104 (review)
Specifically:
Please discuss the changes made, Abit's concerns, and anything else you see that should be fixed below.