plasma
plasma copied to clipboard
No constants
var opcodes = constants.opcodes;
^
TypeError: Cannot read property 'opcodes' of undefined
bcoin.constants no more?
Yeah, plasma was written for an alpha version of bcoin that predated the more stable release. The internals have changed a lot since. Unfortunately I haven't had the time to keep this project updated as much as I've wanted to. I'm hoping eventually to take a day to go through and update it to use the modern bcoin APIs (and also at least get the network layer working again).
I tried to replace some vars and stuck at utils.cmp is not a function. The code otherwise looks great. Even if not for production, would serve as great reference implementation for other programmers. Thanks, I hope this day will come soon :)
I'd be willing to chip in on getting it caught up with bcoin - @chjj I know bcoin is designed to support multiple wallets in a multi-tenant sort of way, was that a design goal of plasma as well?
Ok, I've gotten quite a bit of the way: https://github.com/patwhite/plasma/tree/bcoin-upgrade
There are a few sticky places - first, I made a bunch of changes to how you push to transactions because of assertion fails, I tried to follow patterns I saw in bcoin, but feels like a regression to go from enum style to strings (from a push(opcode.OP_IF) to pushSym('OP_IF')). Also didn't know how to push a bn, I serialized to a string...that didn't feel right.
It's still not running any tests, bumping into some crash at a tx.addInput. @chjj or @homakov, would be happy to keep hacking on it with you!
@patwhite i've done a lot of similar fixes too, so i will keep fixing my version
@chjj why in tests both parties deposit in channel?
var channelCapacity = 10 * 1e8;
var channelBalance = channelCapacity / 2;
I haven't seen any use case when both users would need to fund new channel.