Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Allocate input runes evenly to outputs #20

Closed
casey opened this issue Sep 28, 2023 · 3 comments · Fixed by ordinals/ord#2530
Closed

Allocate input runes evenly to outputs #20

casey opened this issue Sep 28, 2023 · 3 comments · Fixed by ordinals/ord#2530

Comments

@casey
Copy link
Owner

casey commented Sep 28, 2023

For a transaction with N outputs, given a transfer of [ID, AMOUNT, N] and M non OP_RETURN outputs, each non OP_RETURN output receives AMOUNT / M runes.

This allows evenly distributing runes to a large number of outputs, without having include a transfer in the runestone for each output.

@summraznboi
Copy link

Nice, I like it! The only concern with AMOUNT / M is how to handle it when it’s not evenly divisible. I assume the most obvious solution is to distribute the modulo M amount from first output onwards until done.

@owenstrevor
Copy link

Apologies in advance: this comment doesn't have any content.

Just want to say, LFG!!!

@casey
Copy link
Owner Author

casey commented Sep 29, 2023

Nice, I like it! The only concern with AMOUNT / M is how to handle it when it’s not evenly divisible. I assume the most obvious solution is to distribute the modulo M amount from first output onwards until done.

There's already the property that any un-assigned runes are assigned to the first non OP_RETURN output. So each output could get floor(AMOUNT / M), and if M doesn't divide amount, those unassigned runes go to the first non-op return.

@casey casey changed the title EZ Airdrop Allocate input runes evenly to outputs Oct 10, 2023
@casey casey linked a pull request Oct 13, 2023 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants