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
Currently address swap map in the genesis builder maps all assets on the source address to destination address. Implement the possibility to split funds from a source address to secondary address(es).
Address Swapping and Splitting are two different functionalities: the former blindly maps all addresses/funds to the new address, while the latter intends to split off certain amount of funds (and timelocked funds) to a new address. Also, it is unclear yet whether the splitting feature is going to be employed in production, but to be on the safe side we shall implement it.
Therefore, I suggest to implement a new Hornet snapshot output iterator in iota-genesis-builder that preceeds the address swap iterator and splits off funds from the source address before address swapping actually happens.
Requirements
Only support splitting Basic Outputs to the destination address from the source address that are either:
a. Basic outputs with only an address unlock and iota tokens,
b. Basic outputs with address & timelock unlock and iota tokens.
Splitting shall happen on the Hornet snapshot, before it is handed over to the object transformation logic.
Splitting(&swapping) shall happen before the already existing address swap process is carried out.
The amount of timelocked and non-timelocked funds to split shall be configurable.
When source address has more timelocked tokens than the desired split amount, prioiritize later timelocks to be splitted to destination.
Add e2e migration test case(s) that use the split feature and verify the existence of funds on destination address within the started move chain.
Proposed Solution
Add a new optional input to iota-genesis-builder binary: split_map.csv. An example split_map.csv:
Description
Currently
address swap map
in the genesis builder maps all assets on thesource
address todestination
address. Implement the possibility to split funds from asource
address to secondary address(es).Address Swapping
andSplitting
are two different functionalities: the former blindly maps all addresses/funds to the new address, while the latter intends to split off certain amount of funds (and timelocked funds) to a new address. Also, it is unclear yet whether the splitting feature is going to be employed in production, but to be on the safe side we shall implement it.Therefore, I suggest to implement a new Hornet snapshot output iterator in
iota-genesis-builder
that preceeds the address swap iterator and splits off funds from thesource
address before address swapping actually happens.Requirements
Basic Outputs
to thedestination
address from thesource
address that are either:a. Basic outputs with only an address unlock and iota tokens,
b. Basic outputs with address & timelock unlock and iota tokens.
source
address has more timelocked tokens than the desired split amount, prioiritize later timelocks to be splitted todestination
.destination
address within the started move chain.Proposed Solution
iota-genesis-builder
binary:split_map.csv
. An examplesplit_map.csv
:Tokens
andTokensTimelocked
are denominated innanos
, notmicros
!destination
addresses fromsplit_map.csv
Are you planning to do it yourself in a pull request?
No.
The text was updated successfully, but these errors were encountered: