Mainnet library update

3 366
Avatar for mainnet
4 years ago

It has been 1.5 months since the Flipstarter for mainnet library was successfully funded, so it's about time for an update.

Things always take way more than you originally planned and you go through a few dead ends at the beginning.

I wish I could write that we have a working prototype now, but no. Not yet.

We're close to getting single address wallets working though.

It took about 2 weeks to find somebody who can execute on this plan and I had finally settled on 2qx - an awesome developer, who has since been working on the library. So, when I write "we created" I mostly mean "2qx created", but use "we" as in "organization".

At the moment of writing, the scope of things is limited to creating single address wallets, getting balances (in sats, BCH and USD), signing, sending transactions, getting UTXOs and showing QR codes on mainnet, testnet and regtest (for local testing) Bitcoin Cash networks. Alas, while this is close to being working, it still isn't and also the interface is still changing.

You can start the REST server, you could try to use the library, but you'll stumble into one or two bugs that prevent the whole thing from working. They aren't hard to fix, it's just that we need a bit more time to do it.

We have created a REST server that will be used by bindings in every language except JavaScript/TypeScript. This server is written in TypeScript and uses Swagger, so therefore we can automatically generate bindings in mostly any programming language. For starters we've decided to settle on generating C++, C#, Java, JavaScript, PHP (php-laravel is possible), Python, Ruby, (Ruby-sinatra is possible), Typescript-fetch, TypeScript-node, Android, Swift, C, Go, maybe Rust, but we'll publish the instructions on how to generate any binding supported by swagger codegen (list here).

The bindings are a bit awkward to use, for example in PHP:

$walletId = 'wif:mainnet:2SamS....';

$walletApi = new WalletApi();
$balance = $walletApi->balance(new SerializedWallet(['wallet_id' => $walletId]));
print($balance->usd);

...for auto-generated code, this is pretty good.

You could, of course, just call the REST API directly (without the generated bindings).

You can kind of get a feeling of how the REST API will look like here (this is not final, though).

Bad news? Still doesn't work, because of some bugs.

Hopefully, within a week or two, we'll get a first working prototype release.

Next thing in queue after we're done with this: escrow contracts and CashScript.

(We actually already started working on it, when we discovered some problems with the wallets implementation, so we had to return to it).

Escrow contracts are pretty useful for building non-custodial platforms (take some money from the buyer, and if seller completes the agreement - forward the money to him or issue a refund it he doesn't), so that's why we've decided to take them next.

WebHooks (get notified when somebody pays to your address) and SLP tokens should come after that.

Here's the current plan that we should follow (though the order could change):

13
$ 9.62
$ 5.00 from @jtoomim
$ 1.12 from @TheRandomRewarder
$ 1.00 from @emergent_reasons
+ 3
Avatar for mainnet
4 years ago

Comments

This line of code remind me of the school days

$ 0.00
4 years ago

brilliant your article sir...so many information read your article.go ahead best of luck

$ 0.00
4 years ago

Great progress!

$ 0.00
4 years ago