Bitcoin Forum
May 04, 2024, 01:29:02 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 3 4 5 6 7 8 9 10 »
1  Economy / Gambling discussion / Re: bustabit.com - New seeding event on: March 03, 2024, 06:36:10 PM

You need to use the previous hash. So, if prevGameHash is the hash of game #10002812, you have to validate the signature of game #10002813, and so on. I didn't try to run your code, but you probably want to use hexToBytes instead of Uint8Array(Buffer.from(foo)) where you declare prevGameHash and vxSignature.

Yep, you're right, hexToBytes did the trick, thanks a lot! And a last question (I promise it'll be really last one :-) ) : How could I deduct vxSignature for the next (in the reverse manner) hash/game ? return bls.verify(vxSignature, message, VX_PUBKEY); just gives me back true/false like a validation, whether the current signature is correct (or not).

In any case many thanks again, Leo, for your co-operation, I really appreciate it!

No problem at all! Happy to help. Well, it's Vx that gives us that signature, so you need to communicate with its API. For example, in the same verifier, we call getVxSignature (line 12 in https://stackblitz.com/edit/bustabit-verifier?file=src%2Futils%2Fvx.ts), validate it, and then finally use it to generate the game's result.

Ah, I thought this in the meantime (and yes, this make a sense, actually). Anyway, is there API for bustabit.com as well? If I'd get VxSignature from Vx, I can get the game result for specific game directly (provided that I trust the result even without verification via vxSignature, of course :-) ).
2  Economy / Gambling discussion / Re: bustabit.com - New seeding event on: March 01, 2024, 04:22:03 PM

You need to use the previous hash. So, if prevGameHash is the hash of game #10002812, you have to validate the signature of game #10002813, and so on. I didn't try to run your code, but you probably want to use hexToBytes instead of Uint8Array(Buffer.from(foo)) where you declare prevGameHash and vxSignature.

Yep, you're right, hexToBytes did the trick, thanks a lot! And a last question (I promise it'll be really last one :-) ) : How could I deduct vxSignature for the next (in the reverse manner) hash/game ? return bls.verify(vxSignature, message, VX_PUBKEY); just gives me back true/false like a validation, whether the current signature is correct (or not).

In any case many thanks again, Leo, for your co-operation, I really appreciate it!
3  Economy / Gambling discussion / Re: bustabit.com - New seeding event on: February 29, 2024, 11:42:03 AM
Yeah, thanks, I probably missed it. It just looks like it needs lot of modules/dependencies for a "webrunning", which I don't need, so I'm transferring the code to the Node.JS format (I hope I'm close now, otherwise I'll think about re-writing the code into Python, someday Smiley ).

Just a question to a second part of code (generating vxSignature) :

Code:
import { bls12_381 as bls } from "@noble/curves/bls12-381";
import { concatBytes, utf8ToBytes } from "@noble/hashes/utils";

const VX_PUBKEY = "b40c94495f6e6e73619aeb54ec2fc84c5333f7a88ace82923946fc5b6c8635b08f9130888dd96e1749a1d5aab00020e4";

function validateSignature(
  gameSalt: string, // the hash of block 831500
  prevGameHash: Uint8Array,
  vxSignature: Uint8Array
) {
  const message = concatBytes(prevGameHash, utf8ToBytes(gameSalt));
  return bls.verify(vxSignature, message, VX_PUBKEY);
}

What is input for the validateSignature function, are they the results from the previous hash ? So, if I'm finding e.g. vxSignature for game #10002813, do I have to find and input here prevGameHash of game #10002812, and the vxSignature of this game as well?

Yeah, that's correct. We concatenate the previous game hash with our game salt, and ask Vx to sign the message. Vx gives us as a signature (which reveals the previous game to Vx) and then what that function does is to verify that the signature is authentic. By the way, there is also a crash demo here, in case you haven't seen it.

Interesting. I tried to "re-make" second part of code for Node.js and game #10002812, in that way :

Code:
const BLS = require('./node_modules/@noble/curves/bls12-381.js');
const CB = require('./node_modules/@noble/hashes/utils.js');
const U8TB = require('./node_modules/@noble/hashes/utils.js');

const VX_PUBKEY = "b40c94495f6e6e73619aeb54ec2fc84c5333f7a88ace82923946fc5b6c8635b08f9130888dd96e1749a1d5aab00020e4";

// this is prevGameHash for the game #10002812
var prevGameHash1 = "cde36243fc801dc2c77ba6284c81c5fc047039f217e704eb0edafc14e3d1b0a2";
let prevGameHash = new Uint8Array(Buffer.from(prevGameHash1));
  console.log(prevGameHash.length);
  console.log(prevGameHash);
var gameSalt = "000000000000000000011f6e135efe67d7463dfe7bb955663ef88b1243b2deea";
// this is vxSignature for the game #10002812
var vxSignature1 = "8b1ac9ffd6f0594be105c248a56c23e628b088ba4d6c8407c4dd4f406a977a2f68afc83f82a002a36c10df0cd2a3a9430703beec34ae1f218458237c49d39bef0ede106f53d1c3036fef3442d32900af207d03cfe9c46e49ac1d0c304d35ceff";
// this is vxSignature for the game #10002813
//var vxSignature1 = "8f2466a009be4b370d12fe90a9fcc89dbefe1ac08240877a82e16a6e2c0be6a4a0db43bc52dd5eab886fb61dc13d714504af001f4377b0ca2fc269fa3f5fc871c1c61ef6e9f2cd5e862354d5955c0a9c8674dcd7d291a82c448e4f3c68126bad";
let vxSignature = new Uint8Array(Buffer.from(vxSignature1));
  console.log(vxSignature.length);
  console.log(vxSignature);
const message = CB.concatBytes(prevGameHash, U8TB.utf8ToBytes(gameSalt));
  console.log(message.length);
  console.log(message);
return BLS.bls12_381.verify(vxSignature, message, VX_PUBKEY);

When I use vxSignature for the game #10002812, it gives me node_modules/@noble/curves/bls12-381.js:144 throw new Error('No root'); . When I change vxSignature for the game #10002813, it gives me node_modules/@noble/curves/abstract/weierstrass.js:258 throw new Error('bad point: not in prime-order subgroup');.

Just for sure - the length of the prevGameHash is 64 bytes, length of the vxSignature 192 bytes and lenght of the message 128 bytes, correct ? Maybe there will be some issue with the re-code of string to Uint8Array in Node.js ...
4  Economy / Gambling discussion / Re: bustabit.com - New seeding event on: February 29, 2024, 02:32:35 AM

Have you seen the new verifier I wrote? It runs in the browser and already does what you're asking for (uses a vxSignature to calculate game results). Take a look at this file to see how you could do it.

Thanks, that TypeScript looks great! Just tell me, please, (from) where should I import ./constants, ./utils/math and ./utils/vx ? Thanks!

You could just copy those from the verifier, they are all there. Just make sure you import the right dependencies and it should work.

Yeah, thanks, I probably missed it. It just looks like it needs lot of modules/dependencies for a "webrunning", which I don't need, so I'm transferring the code to the Node.JS format (I hope I'm close now, otherwise I'll think about re-writing the code into Python, someday Smiley ).

Just a question to a second part of code (generating vxSignature) :

Code:
import { bls12_381 as bls } from "@noble/curves/bls12-381";
import { concatBytes, utf8ToBytes } from "@noble/hashes/utils";

const VX_PUBKEY = "b40c94495f6e6e73619aeb54ec2fc84c5333f7a88ace82923946fc5b6c8635b08f9130888dd96e1749a1d5aab00020e4";

function validateSignature(
  gameSalt: string, // the hash of block 831500
  prevGameHash: Uint8Array,
  vxSignature: Uint8Array
) {
  const message = concatBytes(prevGameHash, utf8ToBytes(gameSalt));
  return bls.verify(vxSignature, message, VX_PUBKEY);
}

What is input for the validateSignature function, are they the results from the previous hash ? So, if I'm finding e.g. vxSignature for game #10002813, do I have to find and input here prevGameHash of game #10002812, and the vxSignature of this game as well?
5  Economy / Gambling discussion / Re: bustabit.com - New seeding event on: February 28, 2024, 08:02:29 AM

Have you seen the new verifier I wrote? It runs in the browser and already does what you're asking for (uses a vxSignature to calculate game results). Take a look at this file to see how you could do it.

Thanks, that TypeScript looks great! Just tell me, please, (from) where should I import ./constants, ./utils/math and ./utils/vx ? Thanks!
6  Economy / Gambling discussion / Re: bustabit.com - New seeding event on: February 27, 2024, 05:24:58 PM

E.g. this is "prevHash" for game #7600000 (so I'm able to count all the games from #7600000 till hash of the game as a parameter of this script). So I supposed, when I replace this prevHash with (e.g.) hash of game #10000001, and change salt ("let bust = gameResult" row) to the new one ( 000000000000000000011f6e135efe67d7463dfe7bb955663ef88b1243b2deea), everything will work again. But it is not Wink. So, could you tell me, please, how could I extend this script (vxSignature is necessary?), for properly working again? Thanks a lot!

PS: The script that I mentioned above I successfully ran as "node script.js" from linux command line. Now I'm trying to process your code in the same manner (or like /usr/bin/node script.mhs), but it has probably troubles with the type definition in the function (e.g. hash: Uint8Array, gameSalt: string, etc.), it gives me SyntaxError: Unexpected token ':' error. So, if you'd place example here, how to run this JS script (ideally from the cmd line as well), it'll be really useful.
7  Economy / Gambling discussion / Re: bustabit.com - New seeding event on: February 27, 2024, 08:39:26 AM
In the "previous bustabit", I used this part of code for calculating hash and game result :

Code:
var CryptoJS = require('./node_modules/crypto-js/crypto-js.js');
var isVerifying = false;

  var hash_input = process.argv[2];

  let prevHash = null;
 
  while (prevHash != 'f7a0cc38f223a24f40ca70faa4adb433be79be3eaf9ac8b37da39f57f1f8ed62') {
    let hash = String(prevHash ? CryptoJS.SHA256(String(prevHash)) : hash_input);
    let bust = gameResult(hash, '0000000000000000004d6ec16dafe9d8370958664c1dc422f452892264c59526');
   
    console.log(bust, hash);

    prevHash = hash;
  }

function gameResult(seed, salt) {
  const nBits = 52; // number of most significant bits to use

  // 1. HMAC_SHA256(message=seed, key=salt) 
  const hmac = CryptoJS.HmacSHA256(CryptoJS.enc.Hex.parse(seed), salt);
  seed = hmac.toString(CryptoJS.enc.Hex);

  // 2. r = 52 most significant bits
  seed = seed.slice(0, nBits / 4);
  const r = parseInt(seed, 16);

  // 3. X = r / 2^52
  let X = r / Math.pow(2, nBits); // uniformly distributed in [0; 1)

  // 4. X = 99 / (1-X)
  X = 99 / (1 - X);

  // 5. return max(trunc(X), 100)
  const result = Math.floor(X);
  return Math.max(1, result / 100);
};

E.g. this is "prevHash" for game #7600000 (so I'm able to count all the games from #7600000 till hash of the game as a parameter of this script). So I supposed, when I replace this prevHash with (e.g.) hash of game #10000001, and change salt ("let bust = gameResult" row) to the new one ( 000000000000000000011f6e135efe67d7463dfe7bb955663ef88b1243b2deea), everything will work again. But it is not Wink. So, could you tell me, please, how could I extend this script (vxSignature is necessary?), for properly working again? Thanks a lot!
8  Alternate cryptocurrencies / Announcements (Altcoins) / Re: NEM (XEM) Official Thread - 100% New Code - Easy To Use APIs on: October 19, 2021, 07:53:29 PM
forum.nem.io is several days in "read-only mode" (and now DNS record is probably missing), supernodes.nem.io is down (by DNS unreachable as well) for whole today. Does somebody know, what's strange happens with this? Despite these strange issues, the price (of XYM) is rising, which is really remarkable.
9  Alternate cryptocurrencies / Announcements (Altcoins) / Re: NEM (XEM) Official Thread - 100% New Code - Easy To Use APIs on: December 03, 2020, 03:45:11 PM
I noticed the Bittrex wallet maintenance as well since Nov 28.  Their FAQs suggest blockchain upgrades are one of the main reasons this happens. https://bittrex.zendesk.com/hc/en-us/articles/115000233911-What-does-it-mean-when-a-wallet-is-in-maintenance-  They will need to upgrade their xem wallet, so let's hope they get around to it soon.  Usually wallets will be frozen like this for a while.  I just hope they are preparing to announce opt in support! 

Really since Nov 28? Jeez, this is almost one week - which is incredibly long delay (and unfortunately it still persists). Maybe some troubles with XYM implementation (if that's the case) ? Isn't somebody from NEM/Symbol dev team in touch with Bittrex (more generally with all exchanges, these are trying to implement XYM support) ?

In any case I hope this maintenance will not last until launch of XYM will be ready (which will not be earlier than Jan 14) ...
10  Alternate cryptocurrencies / Announcements (Altcoins) / Re: | ARDOR | Scalable Blockchain-as-a-Service Platform | Proof of Stake on: December 03, 2020, 10:02:51 AM
Where can I get information about the TODAY'S economic model of the project, and especially - what is the economic benefit from launching and supporting the nodes ?

There was a reward program for those who run full ARDOR/NXT nodes : https://www.jelurida.com/news/ardor-and-nxt-node-rewards-are-here  That program  was designed to run for 6 months starting from April 1st. Probably it is over at this point   but I think you can communicate with Jelurida support and ask them directly about that.

Jelurida wrote at Sep 30 : "We are happy to announce that our successful #Ardor & #Nxt node rewards program will continue at least until the end of 2020! A total of 7500 IGNIS will be distributed daily to users running full Ardor and/or Nxt nodes!". I really hope they will continue with this reward program also in 2021 year, as this is still one of few things on ARDR blockchain, that make a perfect sense.

But now (for ca 12 hours) reward program is out of order -- maybe some technical maintenance due to new version of Ardor client (2.3.3) ? But I haven't found single word about this as here, as on ardorforum.org - where is till now also no single word about that 2.3.3 version in "Ardor Software Releases" section. This lack of communication thru the "classical channels" is sad.
11  Alternate cryptocurrencies / Announcements (Altcoins) / Re: NEM (XEM) Official Thread - 100% New Code - Easy To Use APIs on: December 02, 2020, 10:37:45 PM
Does somebody know, why Bittrex has - for almost two days - (XEM) "Wallet Disabled - performing routine maintenance" (together for withdraws and deposits) ? Could it be related to XYM implementation ?
12  Alternate cryptocurrencies / Announcements (Altcoins) / Re: | ARDOR | Scalable Blockchain-as-a-Service Platform | Proof of Stake on: November 02, 2020, 12:52:46 PM
Could somebody fix it ? It looks like a problem with certificate (for explorer.jelurida.com) :



Did Not Connect: Potential Security Issue

Firefox detected an issue and did not continue to explorer.jelurida.com. The website is either misconfigured or your computer clock is set to the wrong time.

It’s likely the website’s certificate is expired, which prevents Firefox from connecting securely.

What can you do about it?

explorer.jelurida.com has a security policy called HTTP Strict Transport Security (HSTS), which means that Firefox can only connect to it securely. You can’t add an exception to visit this site.

The issue is most likely with the website, and there is nothing you can do to resolve it. You can notify the website’s administrator about the problem.

Websites prove their identity via certificates, which are valid for a set time period. The certificate for explorer.jelurida.com expired on 10/31/2020.
 
Error code: SEC_ERROR_EXPIRED_CERTIFICATE

What is the issue with their certificate? Just checked it and everything seems to be OK with it, certificate is valid till 30 Dec, 2020. The site is loading fast with no noticeable problem. Security seems to be on the proper level, checked with https://www.urlvoid.com/scan/explorer.jelurida.com/  What could be bothering you?


Read my comments more precisely, please. I wrote that this issue is fixed already. Previous Let's Encrypt certificate has been expired at 2020-10-30, so this caused the situation. In the meantime, somebody (I don't know, if due to my notice here or independently of it) fixed this (renewing process of the certificate). I'm curious, why they haven't this scripted automatically (as most people have), but ... doesn't matter.

Rewarding process still doesn't work, anyway.
13  Alternate cryptocurrencies / Announcements (Altcoins) / Re: | ARDOR | Scalable Blockchain-as-a-Service Platform | Proof of Stake on: November 02, 2020, 10:06:14 AM

Great. Anyway - some changes by the ARDR/NXT reward algorithm ? I see on the blockchain, that some reward transactions are still running, but I didn't received any reward transaction for almost 24hrs, and normally I get several reward transactions per a day. Sure, it can be a statistical coincidence, but I think it's unlikely. Does somebody knows any details ?

Rewarding is stopped for (more than) 24hrs...again. I don't know, if this is related to the weekend trouble with webpages (expired certificate, this has been fixed already), but...it's sad. What is more sad for me, is total lack of communications, as here on bitcointalk, as on ardorforum.org -- do we still have some active users somewhere ?
14  Alternate cryptocurrencies / Announcements (Altcoins) / Re: | ARDOR | Scalable Blockchain-as-a-Service Platform | Proof of Stake on: October 31, 2020, 04:50:45 PM
Could somebody fix it ? It looks like a problem with certificate (for explorer.jelurida.com) :



Did Not Connect: Potential Security Issue

Firefox detected an issue and did not continue to explorer.jelurida.com. The website is either misconfigured or your computer clock is set to the wrong time.

It’s likely the website’s certificate is expired, which prevents Firefox from connecting securely.

What can you do about it?

explorer.jelurida.com has a security policy called HTTP Strict Transport Security (HSTS), which means that Firefox can only connect to it securely. You can’t add an exception to visit this site.

The issue is most likely with the website, and there is nothing you can do to resolve it. You can notify the website’s administrator about the problem.

Websites prove their identity via certificates, which are valid for a set time period. The certificate for explorer.jelurida.com expired on 10/31/2020.
 
Error code: SEC_ERROR_EXPIRED_CERTIFICATE
15  Alternate cryptocurrencies / Announcements (Altcoins) / Re: | ARDOR | Scalable Blockchain-as-a-Service Platform | Proof of Stake on: June 11, 2020, 06:15:35 PM

Great. Anyway - some changes by the ARDR/NXT reward algorithm ? I see on the blockchain, that some reward transactions are still running, but I didn't received any reward transaction for almost 24hrs, and normally I get several reward transactions per a day. Sure, it can be a statistical coincidence, but I think it's unlikely. Does somebody knows any details ?
16  Alternate cryptocurrencies / Announcements (Altcoins) / Re: | ARDOR | Scalable Blockchain-as-a-Service Platform | Proof of Stake on: June 01, 2020, 05:10:19 PM
Tech question: Can I run two Ardor (NRS) instances (on the same tcp ports) on one server, if that server has two real IPs ?

Of course I know, that I can distinguish both instances in `nxt.peerServerHost' and `nxt.MyAddress' directives in nxt.conf configuration file.

But it will not work for OpenAPI instance, as `nxt.ApiServerHost' directive should be (with the value) 0.0.0.0 (otherwise Ardor Explorer cannot recognize this peer as OpenAPI one).

Thnx for any hint.
17  Alternate cryptocurrencies / Announcements (Altcoins) / Re: NEM (XEM) Official Thread - 100% New Code - Easy To Use APIs on: September 12, 2019, 08:26:29 AM
Despite all the positive facts and news about upcoming (as we all hope) Catapult, our boat is still sinking - now we're on the #27 position on CMC, which is another "low high". Does anybody know some "reasonable reason" ? And no, "all altcoins / whole market is/are falling" isn't argue, I think - as we're falling (among with Lisk) hardest from TOP50 table (-14.09% in 7days chart) ... :-(
18  Alternate cryptocurrencies / Announcements (Altcoins) / Re: NEM (XEM) Official Thread - 100% New Code - Easy To Use APIs on: July 14, 2019, 03:04:04 PM
NEM Price Rises Quickly as Traders Target $0.05

Roll Eyes Roll Eyes Roll Eyes Roll Eyes Roll Eyes

https://nulltx.com/nem-price-rises-quickly-as-traders-target-0-05/

What sort or noise are they trying to make? Pin Drop?
This project needs massive PR campaign.
Catapult very soon like a year ago lol.


Yeah, it needs, if it isn't too late at all. Now we've been kicked out into #24 position on CMC (which is the "lowest record" for the long time, I guess). As I mentioned here some time ago, I'm afraid, that staying out of TOP20 for the longer period is something like "kiss of death". The way back is (will be) very complicated or almost impossible, regardless how great is the tech of the coin (here I'm still believe it's great by NEM, despite all the delayed actions with Catapult and so) and how great is the marketing (here I'm really not sure what should I think) ...

Of course now is the situation hard for all the altcoins (and nobody knows, when and if ever the alt-season will begin), but ...
19  Alternate cryptocurrencies / Announcements (Altcoins) / Re: NEM (XEM) Official Thread - 100% New Code - Easy To Use APIs on: May 10, 2019, 01:49:01 PM
The last ATH wasn't fueled by fundamentals or how well the foundation was managed. It was based on speculation and fomo, plus a bit of pumping from the WeChat rumor.  The whole of the crypto market was pumped during that time on the back of the BTC highs and additional liquidity from selling off of free forked BCH. When the whole market has large price rises in the future, NEM will also rise along with the other alts.

Any technical enhancements and Catapult release will be a bonus.

Sure; question is, how "widespread-capable" this bonus will be (if any). We're for more than a month on #22 position, now we're slowly falling into #23 position on CMC. Lot of people mentioned that "there are a lot of crapcoins and doesn't matter about the CMC position". I partly agree - surely there are several crapcoins (coins with much less technical potential) in front of us. But - unfortunately - I think that for the "widespread" really matters, how high or low we're on the charts. Let's see all these Cointelegraph & so articles - if they elaborate and publish some articles or charts about the coins, they focused usually about TOP10 coins, TOP20 at maximum. Which means that we're out of radar now. Sad and ufair? Probably yeah, but that's how the real life goes. And I'm afraid if we'll not back in TOP20 soon, we'll fall into serious troubles, no matter how big and great will be Catapult (or any other part of NEM ecosystem) update. Let's see the history with NXT. I strongly hope that we'll not repeat the same scenario. And yes, despite of these hard and unclear times, I'm still hodling...
20  Alternate cryptocurrencies / Announcements (Altcoins) / Re: NEM (XEM) Official Thread - 100% New Code - Easy To Use APIs on: March 30, 2019, 07:52:54 PM
Happy #Nemesis Day! Wishing Catapult will go live soon! What’s your wish #NEMbers?

https://crypto.watch.impress.co.jp/docs/news/1177163.html


Happy #Nemesis Day! Four years ago today, the core devs @Jaguar0625 @NCOSIGIMCITYNRE created the Nemesis Block and the #NEM Blockchain came into existence. Happy 4th! 🚀

Yes, happy 4th and hopefully we will able to say someday in the future "happy 4th place [on CMC]". Now we're on 21st place (it's historical low, isn't?), and this is really "dangerous", as we're out of radar on most places (lot of webs and newspapers report just TOP10, or TOP20 coins at maximum). Good luck for all of us, nemsters!
Pages: [1] 2 3 4 5 6 7 8 9 10 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!