-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: nexus works with custody unlocking #152
Conversation
Signed-off-by: homura <[email protected]>
Signed-off-by: homura <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #152 +/- ##
==========================================
- Coverage 87.22% 86.12% -1.10%
==========================================
Files 48 45 -3
Lines 814 872 +58
Branches 97 114 +17
==========================================
+ Hits 710 751 +41
+ Misses 21 20 -1
- Partials 83 101 +18 see 31 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
the naming of "P2SH" is ambiguous, we will use "self-owned" asset and "custody" asset as the term |
There is a new ACID (i.e. Auth, Combine, Injection, Delegation) concept that has been proposed, and the ownership will be described as these four types, and we need to consider making changes correspondingly |
So for assets controlled by contracts, the contract will require the user to prove his identity, and then the contract | ||
will decide whether to allow the user to operate the asset. The [ | ||
cheque](https://github.com/duanyytop/ckb-cheque-script/blob/89c0ef98e161882a374e2c091147808f30ca5c5b/contracts/ckb-cheque-script/src/entry.rs#L47-L53) | ||
lock is an example, its unlocking(claiming) rule is: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be one of its unlocking(claiming) rule is:
Because cheque has another unlocking rule, reiver_signature on the cheque cell, and I think that rule is more suitable for a wallet, because in that way, cheque cell won't require any balance held by the receiver lock.
In the rule described here, the receiver must have some balance on the blockchain, making it not so convenient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, but to simplify the understanding, I only took the custody-unlocking part, I think this simplified model can be easier to understand with custody-unlocking
## Working With Existing Contracts | ||
|
||
However, not all systems have implemented custody unlocking, but adding custody unlocking rules may not be difficult. In | ||
general, the contracts will have a design similar to `flag`/`version` for extensibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems flag
/version
is a pattern for contracts. But there is nothing about version in context. Can you add more detail to explain it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the next section, I use .bit as an example of how the flag in .bit type script can be migrated to custody unlocking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the next section, I use .bit as an example of how the flag in .bit type script can be migrated to custody unlocking
and where is the 'version
'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version
is a bit similar to flag when used to update contract, so I put them together
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can request an external developer(Not belongs to Nexus) review this PR. If he is no doubt and understand all of it, It means the document is well readable.
You're right, but non-contributors may pay less attention to PRs, and review by contributors is to ensure that the documentation makes sense first, and if users have any suggestions, we'd welcome any |
🚀 PR was released in |
What Changes
Resolve #132
A documentation for how rule-based ownership to work with Nexus with custody-unlocking
https://github.com/ckb-js/nexus/blob/docs-p2sh/docs/custody-unlocking.md
Motivation
Change Type
Indicate the type of change your pull request is:
documentation
patch
minor
major
🐤 Download canary assets:
nexus--canary.152.4528074063.zip