-
Notifications
You must be signed in to change notification settings - Fork 3
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
Tool to "compile" and create spending condition tx — Part 1 #15
Comments
Since we are on it, would be pretty cool to do something about conditional outputs. |
@MaxStalker yeah, this will be a Part 2 for the tool. Something like this:
Schematically: const tx = await AirSpencon.create(paramsArr, plasmaClient);
// ... tx here has one LEAP input (selected by the tool using `plasmaClient`) with script and msgData created from `paramsArr` and maybe one LEAP output with change (if needed)
// user adds the rest of the inputs here
tx.inputs.push(...)
await AirSpencon.checkAndSend(tx, privKey); // emulate, add all the outputs, sign and send |
Nice, I appreciate the tooling work here. I'm forming a new spending condition design in my head that still uses the underlying UTXO model for 'state changes' but otherwise works like on the ethereum root chain. I'm going to sketch something up soon, so stay tuned. In the meantime, 💯 for the tooling work here. ✊ |
this is kind of difficult. replacements can go wrong if the byte before the address is also |
EF-grant! |
good point. Now I see why the placeholders were always so weird :) |
How about using the same pattern then for the first 19 bytes and put the placeholder index in the last byte? |
another very rough idea was to have library contracts for the different environments, containing the constants, which then can be imported. but that would require recompiling contracts when deploying from testnet to mainnet. |
requesting to upsize this one to M because on a second glance it looks underfunded esp. for proper review (I anticipate a long review here) |
upsized optimistically. Let me know in case of objections |
Bounty
This issue takes #5 couple of steps further.
Currently, it is a big deal to create a spending condition transaction. First, you need to create an address, which is fairly easy still requires some boilerplate. Second, when you are about to create a spending condition tx you need to a) know which inputs and outputs to supply b) write more boilerplate like including LEAP input with script and encoded msgData. As a user you will need to study the spencon code to effectively execute it, which makes adoption harder.
Proposal is to create a tool to generate a helper object for each spencon. This helper can be then dropped in a client app and used to simplify making spending condition tx.
Scope
create a tool like this:
Input:
0x1111...111
,0x2222...222
and so on.Output:
A
<contract>.js
file exporting an object (SpenCon object) with:allow to run the tool from command line
allow to use the tool programmatically in javascript code (allow
require
)publish the tool in npm (
leapc
😃)add an instruction to docs.leapdao.org
Deliverables
Gain for the project
Publicly visible delivery
Roles
bounty gardener: @troggy / 10%
bounty worker: name / share
bounty reviewer: name / share
Funded by
Dev Circle
The text was updated successfully, but these errors were encountered: