Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 15 09:41
    italy starred ActorForth/ActorForth
  • Sep 06 11:38
    JacekAndrzejewski starred ActorForth/ActorForth
  • Aug 20 00:11
  • Aug 20 00:11
    baby636 starred ActorForth/ActorForth
  • Jun 12 09:53
    siraben commented #1
  • Jun 12 09:53
    siraben commented #1
  • May 26 06:44
    scherrey commented #23
  • May 23 17:10
    Sameeranjoshi commented #23
  • May 21 12:37

    scherrey on filepos

    Updated refdocs. (compare)

  • May 20 10:11

    scherrey on filepos

    Added compiling to categories a… Merge branch 'filepos' of githu… (compare)

  • May 12 07:34
    Sameeranjoshi commented #23
  • May 12 07:16
    scherrey commented #23
  • May 12 07:16
    scherrey commented #23
  • May 12 05:33
    Sameeranjoshi commented #23
  • May 12 05:32
    Sameeranjoshi commented #23
  • May 09 17:06

    scherrey on filepos

    Add initial Makefile. Uncomment… Improve parallel builds. Improve parallel builds. and 7 more (compare)

  • May 08 13:51
    MayaPosch commented #23
  • May 08 13:45

    MayaPosch on master

    Separate unit tests into separa… (compare)

  • May 08 09:56
    scherrey closed #17
  • May 08 09:56
    scherrey commented #17
Ben Scherrey
@scherrey
  1. If you're using js then yes, bch-api and bch-js are what we support (as well as bitbox for typescript). For python it's BitCash.
  2. One of my staff will have to follow up with you on that.
  3. Our deployment fully supports the rest.bitcoin.com model so tools that work there can point to your instance and should just work.
  4. I think one of my team will be able to provide something along those lines tomorrow. (It's 11p BKK time now. Not sure what time zone you're in.)
1 reply
Nicolai Skye
@nicolaiskye

Questions:

  1. Is the rest API catered specifically for the bch-api?
  2. How do I set up a wallet? (Electron cash GUI hasn't opened up for me)
  3. The application I was writing hits the endpoints from https://rest.bitcoin.com/ can I still use this tool for these cases?
  4. Is there a hello world example of how to use the tool after successfully installing everything?
  1. Two REST APIs are provided with the toolkit. There's one that's based on "rest.bitcoin.com" which is used by SDKs like Bitcash (Python), and one based on "bch-api" which is used by SDKs like bch-js (JavaScript). Other SDKs that use either of these endpoints may also work, but you would need to ensure they support addresses with the "bchreg:" prefix. I've found that in many projects, the maintainers only provide "bitcoincash:" and "bchtest:" by default.

  2. The node itself has a basic wallet built-in. You can access it with the ./bitcoin-cli command, and running./bitcoin-cli help will get you the full list of commands. I most commonly use ./bitcoin-cli sendtoaddress bchreg:[myaddress] 100 in order to send funds to my addresses (generated from Bitcash or bch-js) so that I have satoshis to play around with. Additionally ./bitcoin-cli generate 10 (or whatever number of blocks you want to generate) is very useful, and is one of the biggest benefits of having a local node (i.e., controlling exactly when blocks get mined). Electron Cash doesn't currently support the "bchreg:" prefix, and so currently isn't usable with our toolkit.

  3. Yes, if you're able to redirect your application to localhost:12500 instead of rest.bitcoin.com, then it should work just as you'd expect the mainnet API to work.

  4. That's a great idea. I'll try and put together some examples and documentation to make getting started with the toolkit easier. In the meantime, if you can let me know what SDK you're using, I can probably help with a few examples and make sure it's set up and working with the toolkit as expected.

2 replies
Trayson Kala Keli'i
@traysonkelii

Here is my current flow towards trying to successfully hit localhost:12500 and verify that the address I created and the amount that I sent to it was correct.

Create bchreg address. I created it via the following code (could have also been made with the bitcoin-cli)

const bitcore = require('bitcore-lib-cash');
bitcore.Networks.defaultNetwork = bitcore.Networks.regtest;

var privateKey = new bitcore.PrivateKey();
var publicKey = new bitcore.PublicKey(privateKey)

console.log('WIF:', privateKey.toWIF());
console.log('cashaddr:', publicKey.toAddress().toString());

ran the following command to send some money to the address:

/bitcoin-cli sendtoaddress bchreg:qre76hccdcmrj8jafcy6gzcgyum9650g95cj7cf62k 100

this returns what I assume is the txid 4cabb8f034538d52e938e2c22f3828fd06b366d3b5c50e05bb52332a96e0fa8b.

leveraging bitbox SDK and slpjs I attempt to hit the localhost instance at port 12500. Here is what I have scripted up:

const BITBOXSDK = require('bitbox-sdk')
const slpjs = require('slpjs');

let addr = 'bchreg:qre76hccdcmrj8jafcy6gzcgyum9650g95cj7cf62k';
const BITBOX = new BITBOXSDK.BITBOX({ restURL: 'http://localhost:12500/' });

const bitboxNetwork = new slpjs.BitboxNetwork(BITBOX);

let balances;
(async function() {
  balances = await bitboxNetwork.getAllSlpBalancesAndUtxos(addr);
  console.log("balances: ", balances.nonSlpUtxos[0].amount);
})();

I am getting the following error here and I am trying to trace it:

(node:88847) UnhandledPromiseRejectionWarning: #<Object>
(Use `node --trace-warnings ...` to show where the warning was created)
(node:88847) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:88847) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(base) traysonkelii@Traysons-MacBook-Pro bch_regtest % node --trace-warnings balance.js
(node:88861) UnhandledPromiseRejectionWarning: #<Object>
    at emitUnhandledRejectionWarning (internal/process/promises.js:170:15)
    at processPromiseRejections (internal/process/promises.js:247:11)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)
(node:88861) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:88861) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    at emitDeprecationWarning (internal/process/promises.js:180:11)
    at processPromiseRejections (internal/process/promises.js:249:13)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)

Can I get a santity check? Am I doing this right?

Napat
@SuperCipher
I believe the current bitbox-sdk and slpjs is not regtest compatible
If you want to go with JS route I suggest you to use bch-js-reg which is bitbox-sdk forked. It’s work with bch-api with is similar to rest.bitcoin.com the. rest.bitcoin.com is close source but bch-api is opensource that you can host your own. currently bch-api is not working in the refactor branch. We are working on getting master brach back working as intend and once that done we will notify you.
2 way to sanity check
  1. using bitcoin-cli (always the best way to verify transaction)
    ./bitcoin-cli getrawblocktransactions 4cabb8f034538d52e938e2c22f3828fd06b366d3b5c50e05bb52332a96e0fa8b
    after you get a raw hex transaction
    ./bitcoin-cli decoderawtransaction hextransaction
    would suggest you to play around with ./bitcoin-cli help
  2. using rest.bitcoin.com
    go to http://localhost:12500
    go to /rawtransactions/getRawTransaction/{txid}
    click try it out button
    input yours txid
Damascene
@uak_gitlab
hey glad to find this community
I've a question about bitcash, I'm using the slp_development version for testing. is there a way to burn tokens in an address?
1 reply
Napat
@SuperCipher

ANNOUNCEMENT :
We have a new beta release v0.1-beta1

This version is a major change. Restructuring how we clone, pull and build image.
We no longer build images locally. It’s now only pulls prebuilt images from Docker Hub.
We also have a Docker Hub organization https://hub.docker.com/u/actorforth to organize all the dependent images.
The changes address issues relating to git submodules not working, and bch-api not working.

Release found here:
https://github.com/ActorForth/bch-toolkit/releases/tag/v0.1-beta1

Viacheslav Litvinov
@litvinof
🎉🎉🎉🎉
Ben Scherrey
@scherrey
Here's the link to our multiple OP_RETURN proposal on BitcoinCashResearch.org
https://bitcoincashresearch.org/t/multiple-op-returns-this-time-for-real/315/11
Napat
@SuperCipher
@traysonkelii
We just improve our getting start page.
https://github.com/ActorForth/bch-toolkit#getting-start
1 reply
Viacheslav Litvinov
@litvinof
Ben Scherrey
@scherrey
yep - another insane bubble. but nft's that have some other inherent value are a real promising thing. We've got ideas on how to make our tickets turn into NFTs with additional value.
siraben
@siraben:matrix.org
[m]
Apparently the Ethereum Foundation is sponsoring this formalization of the Vyper compiler effort: https://github.com/formalize/coq-vyper
Still WIP but seems to have verified the translation of arithmetic and small programs, found the small-step semantics for the bounded imperative language here: https://github.com/formalize/coq-vyper/blob/831ebccfa156670dc1125f7a3ac93f67dedf101e/L10/Stmt.v#L38
siraben
@siraben:matrix.org
[m]
Oh wow, did anyone hear about Fe? Looks like a new smart contract language but notably would compile to an intermediate representation https://snakecharmers.ethereum.org/fe-a-new-language-for-the-ethereum-ecosystem/
Ben Scherrey
@scherrey
Again the Ethereum Foundation just throws its support for things that are not going the direction it needs to be going in order to keep its position as the decentralized compute engine. Such a waste...
Yukai Doge
@yukaijerng_twitter
Guys I need help! I tried to use bitcoin.com wallet to receive SLP NFT and now I can't access them... Is there a way? 😳
Ben Scherrey
@scherrey
Hey Yukai - I'm not sure if that wallet recognizes SLP NFTs. Where did you get the NFT from?
@nicolaiskye do you know what wallets can recognize SLP NFTs?
Yukai Doge
@yukaijerng_twitter
I got the NFT from www.juungle.net
Tried to recover the wallet with Electrum Cash SLP but can't find my SLPs
Ben Scherrey
@scherrey
@nicolaiskye can you try with one of our client APIs to try to confirm the NFTs are withth
that address.
?
Nicolai Skye
@nicolaiskye
Yes, I just used the Bitcash SLP to check, and I can see that @yukaijerng_twitter has 3 NFTs that are part of the same 'parent' group
The main issue it seems now is that you have them sitting in the Bitcoin.com wallet, which does support SLP, but it does not support NFTs
So I'm looking into being able to import the private key into something like Electron Cash SLP instead so you can access your NFTs
Ben Scherrey
@scherrey
Cool - that's what I anticipated was the issue. Glad everything looks good.
Nicolai Skye
@nicolaiskye

Okay, so I've managed to get my Bitcoin.com wallet loaded into Electron Cash SLP and I can see my SLP stuff there. If you follow these steps I think you should be able to get the same result as well.

First, you need your BCH seed from the Bitcoin.com. In Settings -> Security Center -> Manual Backup -> My BCH wallet .. you should be able to get the list of 12 words as your seed.

Then in Electron Cash SLP you can go through the "New/Restore Wallet" prompts. You'll need to select:

  • Standard wallet
  • I already have a seed
  • [write your seed in the textbox]
  • Derivation path: m/44'/0'/0'
After that, you can go to the "Tokens" tab, and you should be able to see your NFTs. @yukaijerng_twitter
Yukai Doge
@yukaijerng_twitter
I’ve done it but the wallet I restored get seems to be incomplete, I couldn’t see my SLPs
Yukai Doge
@yukaijerng_twitter
So we seem to have figured out my Waifu problem!😆 After I used bitcoin.com wallet to receive an NFT, I tried to import the seed to Electron Cash SLP to access them.😂 However Electron didn't include the specific address which contains my NFT (could be something to do with bitcoin.com wallet, not sure), so I couldn't see them and I thought they were lost!😱 In the end we tried <Wallet> -> <Scan more addresses> and my NFTs eventually showed up!🤩 Thank you 😎crypto hackers😎 who helped!🤗
Ben Scherrey
@scherrey
Glad we could help you make some progress. If we can get our SLPDB sync'd up I think we'll be able to do an improvement with the Electron Cash wallet to enable quicker confirmations for NFTs.
Ben Scherrey
@scherrey
@yukaijerng_twitter looks like we have a working fork of Electron Cash SLP you can try at the meetup tonight that will allow verification of NFTs using SLPDB. It's quite fast. Of course, the downside is that you must trust the SLPDB instances that you're using. Nice thing is that we check a list of them so they'd have to all be compromised to give you a false confirmation.
Ben Scherrey
@scherrey
Have updated the Multiple OP_RETURN CHIP to PROPOSED status as well as included some updates including the Bitcoin Unlimited PR.
https://github.com/ActorForth/Auction-Protocol/blob/main/CHIP-2021-03-12_Multiple_OP_RETURN_for_Bitcoin_Cash.md
Ben Scherrey
@scherrey

Several people have reported their NFTs getting locked up in their wallets and unable to verify. Our understanding is that the EC SLP team is working on a long term solution. Until then, we've done a temporary fork of the ElectronCash SLP wallet to support verification by using multiple SLPDB servers. Note that this is not a pure trustless solution as you are trusting that multiple SLPDB servers are being honest.

If you want to check it out you can go here to download it: https://github.com/ActorForth/ECash-SLPDB/releases/tag/3.7.0-beta
here to get support: https://gitter.im/ActorForth/community

And here to see a video that walks you through one of the typical scenarios users have found themselves in: https://www.youtube.com/watch?v=IqnLoLtpslU

Good luck!

We've just posted one more video for people who already have ElectronCash SLP wallet but their SLP tokens are still stuck. Here's how to get them u stuck using our Ecash-SLPDB build just released today. https://youtu.be/nKlF9TWgGyY
Ben Scherrey
@scherrey
For those of you who missed it last night - you can see the replay of our product beta launch here: https://youtu.be/LDZFybcPnco?t=3544
Ben Scherrey
@scherrey

Pleased to announce that we've launched an api endpoint compatible alternative deployment of https://rest.bitcoin.com/ at https://rest.bch.actorforth.org/ . There's also an SLPDB deployment at https://slpdb.bch.actorforth.org/ . You can read more about our ActorForth organization and these new service offerings here: https://docs.bch.actorforth.org/commercial/

Enjoy and please do give us feedback as to how it works for you. This is all based on our prior BCH-toolkit ( https://github.com/ActorForth/bch-toolkit ) project for dev/test environments but now we've deployed a main net version due to bitcoin.com's announcement that they're deprecating their environment. We're actively working on feature and performance enhancements now.

Ben Scherrey
@scherrey
After we learned rest.bitcoin.com was going to be decommissioned we decided to see about connecting our BCH-toolkit project to Main Net. Proud to announce that we've just launched a fully binary compatible deployment of their system (except for 3 apis) at https://rest.bch.actorforth.org . It's rate limited to 4 requests every 3 seconds for free users. Paid tiers with a performance SLA coming soon. No need to change your software for full compatibility, just redirect your requests to our new infrastructure. See https://docs.bch.actorforth.org/commercial/ for details.
Damascene
@uak_gitlab
Hey I'm trying your API in mint.bitcoin.com I replaced their API with yours but I'm getting this errors
Ben Scherrey
@scherrey
Hey Damascene - can you post a copy of the request you're making?
Damascene
@uak_gitlab
@scherrey this?
{"addresses":["bitcoincash:qz0tduraxazgdfrty6ysrstej6cwt46w5cahu7v7pk","bitcoincash:qrt0vu44v9ugwt2ud53wf5ntwnnsuur5fg78c24npq"]}
I'm just adding your rest api to this https://mint.bitcoin.com/#/configure
I can share my seed with you, it has few cents so you can test
Damascene
@uak_gitlab
in a separate subject I would like to request two endpoints. 1. total_received_token to get the total of specific token received on an address and total_sent_token.
Ben Scherrey
@scherrey
Which specific https request were you hitting when you got the 404s?
Ben Scherrey
@scherrey
@uak_gitlab I think I see your requests cause I see a lot of 404 responses. Looks like you're missing the /v2/ at the beginning of your path.
Instead of /address/utxo it should be /v2/address/utxo like https://rest.bch.actorforth.org/v2/address/utxo