docs: v2 asset locks - automatic funding + bech32 addresses#182
Conversation
📝 WalkthroughWalkthroughUpdates the DIP-0027 specification to introduce version 2 Asset Lock transactions featuring automatic credit assignment. Defines supported scriptPubKey forms, specifies v24 hard fork activation, and establishes address-encoding requirements with reference to DIP-0018. ChangesDIP-0027 Specification Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@dip-0027.md`:
- Line 91: Update the DIP text to avoid ambiguity by replacing references to
"pubkey" with "pubkey hash" where appropriate: specifically clarify that in a
`version = 2` Asset Lock transaction each entry in `credit_outputs` MUST be
credited to the Identity matching the entry's pubkey hash (not a raw pubkey) or
script hash, and update any related wording that mentions `pubkey` to `pubkey
hash` to reflect P2PKH locking scripts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
thephez
left a comment
There was a problem hiding this comment.
We might need some more changes, but check these for now
|
|
||
| #### Version 2: Automatic Credit Assignment | ||
|
|
||
| A `version = 2` Asset Lock transaction signals that each entry in `credit_outputs` MUST be automatically credited by Platform to the Identity matching the entry's public key hash or script hash, without an accompanying Identity Registration or Top-Up state transition. |
There was a problem hiding this comment.
Maybe something like this. @PastaPastaPasta what do you think?
| A `version = 2` Asset Lock transaction signals that each entry in `credit_outputs` MUST be automatically credited by Platform to the Identity matching the entry's public key hash or script hash, without an accompanying Identity Registration or Top-Up state transition. | |
| When Dash Platform implemented the Platform address system defined by [DIP-17](https://github.com/dashpay/dips/blob/master/dip-0017.md), there was no way to directly fund a Platform address from the Core chain. Version 2 Asset Lock transactions enable transferring Core chain funds to Platform addresses by signalling that each entry in `credit_outputs` MUST be automatically credited to the Platform address matching the entry's public key hash or script hash. No accompanying state transition is required. |
Co-authored-by: thephez <thephez@users.noreply.github.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
dip-0027.md (1)
92-92: Clarify the relationship between Platform addresses and Identity crediting.A past reviewer noted that "platform addresses aren't linked to particular identities" and asked for clarification. While the current wording states credits are "automatically credited to the Platform address," it would be helpful to explicitly clarify:
- Are credits held by the Platform address itself (independent of any Identity)?
- Or are credits automatically assigned to an Identity derived from or associated with that address?
This clarification would help implementers understand the precise semantics of the automatic credit assignment.
Could you confirm whether the DIP-0017 Platform address system allows addresses to hold credits independently, or if there's an implicit Identity association? Consider adding a brief clarification in the text if the current wording might be ambiguous.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@dip-0027.md` at line 92, Clarify that Version 2 Asset Lock credits in the `credit_outputs` are held by the Platform address itself (matched by the entry's public key hash or script hash) and are not implicitly bound to any Identity unless an explicit identity creation or association operation occurs; update the paragraph mentioning "automatically credited to the Platform address" to state that these credits are stored at the Platform address level and only become associated with an Identity when an explicit Identity is derived from or linked to that address (reference DIP-17, `credit_outputs`, public key hash, script hash, and Identity in the text).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@dip-0027.md`:
- Line 92: Clarify that Version 2 Asset Lock credits in the `credit_outputs` are
held by the Platform address itself (matched by the entry's public key hash or
script hash) and are not implicitly bound to any Identity unless an explicit
identity creation or association operation occurs; update the paragraph
mentioning "automatically credited to the Platform address" to state that these
credits are stored at the Platform address level and only become associated with
an Identity when an explicit Identity is derived from or linked to that address
(reference DIP-17, `credit_outputs`, public key hash, script hash, and Identity
in the text).
…ash core and functional tests 535cb71 test: dashify segwit_addr.py and remove bitcoin's specific code (Konstantin Akimov) 89ec176 partial Merge bitcoin#20861: BIP 350: Implement Bech32m and use it for v1+ segwit addresses (Konstantin Akimov) 7c7e722 Merge bitcoin#19253: Tests: tidy up address.py and segwit_addr.py (Konstantin Akimov) 393ca5e partial Merge bitcoin#11167: Full BIP173 (Bech32) support (Konstantin Akimov) c3261a9 test: regression tests for platform addresses (Konstantin Akimov) 51ce91f feat: add utils to parse platform bech32m destinations (Konstantin Akimov) Pull request description: ## What was done? It's a step forward to implement changes in dip-0008 with platform addresses and asset-lock transactions v2, see dashpay/dips#182 This PR adds code to parse and encode platform bech32m addresses in C++ code and in functional tests. Some changes are done as backports: - partial bitcoin#11167 - merged previously, extra fixes from bitcoin#19253 - partial bitcoin#20861 ## How Has This Been Tested? See changes in regression tests, in functional tests. ``` $ test/functional/test_runner.py rpc_help.py Temporary test directory at /tmp/test_runner_∋_🏃_20260422_014702 Running Unit Tests for Test Framework Modules .................... ---------------------------------------------------------------------- Ran 20 tests in 3.427s ... ``` Amount of unit tests is increased from 19 to 20 as expected. ## Breaking Changes N/A This PR doesn't include any breaking changes in RPCs or consensus related changes. It's an utility PR that could be merged with low risk. ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 535cb71 Tree-SHA512: 38e4a924bb0ea3ac7ff99cefead131a8d1fd806585da86e356e1836c6792c73a1481afcb572e89eb1e4eff9448b234ea4a182f5127f3f4ce9b9b2c1a05a5cf5c
Summary by CodeRabbit