Pages:
Author

Topic: [ANN] Xmining Pool [BCN/XMR/FCN/QCN/XDN/BBR/DSH/AEON] CryptoNote Merge Mining - page 4. (Read 12487 times)

newbie
Activity: 46
Merit: 0
Can developers of  other  pools trust to your code? Is the code universal?
Anything new about this pool and Moneta Verde?
member
Activity: 63
Merit: 10
Can developers of  other  pools trust to your code? Is the code universal?
member
Activity: 64
Merit: 10
It is great!  This is the first pool for Fantomcoin on open source which I was waiting for a long time.
member
Activity: 98
Merit: 10
I'm working to implement Moneta Verde at the moment.

Great! Good luck mate! Im waiting for updates!
member
Activity: 84
Merit: 10
Payout is the same as for all open source pools.

I'm working to implement Moneta Verde at the moment.
newbie
Activity: 87
Merit: 0
Good job guys!
Haven't tried it yet but the description looks promising. I also don't get why did you skip Moneta verde. Huh

Same question. But in general you guys did a great job.
member
Activity: 80
Merit: 10
Fantomcoin opensource mining pool  thats what ive been waiting for!
Massive thanks to those who finally put it together.
newbie
Activity: 253
Merit: 0


I'm curious what payment system is in this pool and what about payouts?
member
Activity: 98
Merit: 10
Good job guys!
Haven't tried it yet but the description looks promising. I also don't get why did you skip Moneta verde. Huh
newbie
Activity: 46
Merit: 0
Good luck. And what about Moneta Verde? Will you add it to your pool?
Yeah, that will be nice. Que viva the merged mining! =D
member
Activity: 84
Merit: 10
Code:
+    b.nonce = nonce;

+    if (b.major_version == BLOCK_MAJOR_VERSION_2) {

+        block parent_block;

+        b.parent_block.nonce = nonce;

+        if (!construct_parent_block(b, parent_block))

+            return except("Failed to construct parent block");

+

+        if (!mergeBlocks(parent_block, b, std::vector()))

+            return except("Failed to postprocess mining block");

+    }

you make merge block in solo mining
I do not understand why you do

There are block of two types: one is traditional blocks (Monero, Bytecoin, QuazarCoin, etc.), while the other one is for Fantomcoin only. This second block type allows merge mining of the first ones and is the only block type accepted by FCN (and MCN). FCN mining requires doing work with the block template of the second type (native to FCN). These blocks also allow merge mining with the first type blocks, but I started with fixing pool's block template to single mine FCN.

As for high orphan rates, I've found two problems. The first one was related to the network parameters, which turned out to be misconfigured. The second one was that the block hash was taken invalidly from the block explorer, which marked valid blocks as orphaned. The fix will be released soon.
newbie
Activity: 53
Merit: 0
Good luck. And what about Moneta Verde? Will you add it to your pool?
member
Activity: 109
Merit: 10
Code:
+    b.nonce = nonce;

+    if (b.major_version == BLOCK_MAJOR_VERSION_2) {

+        block parent_block;

+        b.parent_block.nonce = nonce;

+        if (!construct_parent_block(b, parent_block))

+            return except("Failed to construct parent block");

+

+        if (!mergeBlocks(parent_block, b, std::vector()))

+            return except("Failed to postprocess mining block");

+    }

you make merge block in solo mining
I do not understand why you do
member
Activity: 84
Merit: 10
up to now in your pool
only blocks orphans left
it is not because you are using the function
merge
also to mine only fcn?
miner.cpp from the file miner.cpp
I do not see the use of the merge works
I know that you should not use it
also you do not need to do
the nonce on parentblock
just have to modify the file so pool.js
in this way
Code:
    var shareBuffer = new Buffer(blockTemplate.buffer.length);
    blockTemplate.buffer.copy(shareBuffer);
    shareBuffer.writeUInt32BE(job.extraNonce, blockTemplate.reserveOffset);
    new Buffer(nonce, 'hex').copy(shareBuffer, 73);
no 39 but 73
and in the function convert_blob
you have to use
get_bytecoin_block_hashing_blob

There is no merge mining implemented at the moment. I'm working on the solution but it is way more complicated than just Fantomcoin's blocks support. I hope to release it next week. At the moment Xminingpool implements single mining for FCN.

As for orphaned blocks, it's just the FCN daemon's configuration. I'm tuning it to fix the issue at the moment.
member
Activity: 109
Merit: 10
up to now in your pool
only blocks orphans left
it is not because you are using the function
merge
also to mine only fcn?
miner.cpp from the file miner.cpp
I do not see the use of the merge works
I know that you should not use it
also you do not need to do
the nonce on parentblock
just have to modify the file so pool.js
in this way
Code:
    var shareBuffer = new Buffer(blockTemplate.buffer.length);
    blockTemplate.buffer.copy(shareBuffer);
    shareBuffer.writeUInt32BE(job.extraNonce, blockTemplate.reserveOffset);
    new Buffer(nonce, 'hex').copy(shareBuffer, 73);
no 39 but 73
and in the function convert_blob
you have to use
get_bytecoin_block_hashing_blob
member
Activity: 84
Merit: 10
this is my function
for merge mining

You should take a look at my pull requests to see my solution. It doesn't have the problem that you've mentioned.
member
Activity: 109
Merit: 10
this is my function
for merge mining
in main.cc from node cryptonote util

Code:
Handle merging_block(const Arguments& args) {
    HandleScope scope;

    if (args.Length() < 1)
        return except("You must provide one argument.");

    Local target = args[0]->ToObject();

    if (!Buffer::HasInstance(target))
        return except("Argument should be a buffer object.");

    std::string s = std::string(Buffer::Data(target), Buffer::Length(target));
    std::string block1_blob = s.substr(0, s.find("::")).c_str();
    std::string block2_blob = s.substr(s.find("::")+2, s.find(":-:") - (s.find("::") + 2)).c_str();
    std::string block1_diff = s.substr(s.find(":-:")+3, s.find(":-a:") - (s.find(":-:") + 3)).c_str();
    std::string block1_heig = s.substr(s.find(":-a:")+4, s.find(":-b:") - (s.find(":-a:") + 4)).c_str();
    std::string block2_diff = s.substr(s.find(":-b:")+4, s.find(":-c:") - (s.find(":-b:") + 4)).c_str();
    std::string block2_heig = s.substr(s.find(":-c:")+4, std::string::npos).c_str();

    BlockTemplate m_block1;
    BlockTemplate m_block2;
    std::string blockString;
    std::string blockString2;

    epee::string_tools::parse_hexstr_to_binbuff(block1_blob, blockString);
    std::istringstream stringStream(blockString);
    binary_archive archive(stringStream);
    serialization::serialize(archive, m_block1.block);

    m_block1.difficulty = atol(block1_diff.c_str());
    m_block1.height = atol(block1_heig.c_str());

    epee::string_tools::parse_hexstr_to_binbuff(block2_blob, blockString2);
    std::istringstream stringStream2(blockString2);
    binary_archive archive2(stringStream2);
    serialization::serialize(archive2, m_block2.block);

    m_block2.difficulty = atol(block2_diff.c_str());
    m_block2.height = atol(block2_heig.c_str());
    m_block2.block.timestamp = m_block1.block.timestamp;
    m_block2.block.parent_block.major_version = m_block1.block.major_version;
    m_block2.block.parent_block.minor_version = m_block1.block.minor_version;
    m_block2.block.parent_block.prev_id = m_block1.block.prev_id;
    m_block2.block.parent_block.nonce = m_block1.block.nonce;
    m_block2.block.parent_block.miner_tx = m_block1.block.miner_tx;
    m_block2.block.parent_block.number_of_transactions = m_block1.block.tx_hashes.size() + 1;
    m_block2.block.parent_block.miner_tx_branch.resize(crypto::tree_depth(m_block1.block.tx_hashes.size() + 1));
    std::vector transactionHashes;
    transactionHashes.push_back(cryptonote::get_transaction_hash(m_block1.block.miner_tx));
    std::copy(m_block1.block.tx_hashes.begin(), m_block1.block.tx_hashes.end(), std::back_inserter(transactionHashes));
    tree_branch(transactionHashes.data(), transactionHashes.size(), m_block2.block.parent_block.miner_tx_branch.data());
    m_block2.block.parent_block.blockchain_branch.clear();

    blobdata output = block_to_blob(m_block2.block);
    Buffer* buff = Buffer::New(output.data(), output.size());
    return scope.Close(buff->handle_);
}

Handle refill(const Arguments& args) {
    HandleScope scope;

    if (args.Length() < 1)
        return except("You must provide one argument.");

    Local target = args[0]->ToObject();

    if (!Buffer::HasInstance(target))
        return except("Argument should be a buffer object.");

    std::string s = std::string(Buffer::Data(target), Buffer::Length(target));
    std::string block1_blob = s.substr(0, s.find("::")).c_str();
    std::string block2_blob = s.substr(s.find("::")+2, s.find(":-:") - (s.find("::") + 2)).c_str();
    std::string block1_diff = s.substr(s.find(":-:")+3, s.find(":-a:") - (s.find(":-:") + 3)).c_str();
    std::string block1_heig = s.substr(s.find(":-a:")+4, s.find(":-b:") - (s.find(":-a:") + 4)).c_str();
    std::string block2_diff = s.substr(s.find(":-b:")+4, s.find(":-c:") - (s.find(":-b:") + 4)).c_str();
    std::string block2_heig = s.substr(s.find(":-c:")+4, std::string::npos).c_str();

    BlockTemplate m_block1;
    BlockTemplate m_block2;
    std::string blockString;
    std::string blockString2;

    epee::string_tools::parse_hexstr_to_binbuff(block1_blob, blockString);
    std::istringstream stringStream(blockString);
    binary_archive archive(stringStream);
    serialization::serialize(archive, m_block1.block);

    m_block1.difficulty = atol(block1_diff.c_str());
    m_block1.height = atol(block1_heig.c_str());

    epee::string_tools::parse_hexstr_to_binbuff(block2_blob, blockString2);
    std::istringstream stringStream2(blockString2);
    binary_archive archive2(stringStream2);
    serialization::serialize(archive2, m_block2.block);

    m_block2.difficulty = atol(block2_diff.c_str());
    m_block2.height = atol(block2_heig.c_str());

    std::vector& extra = m_block1.block.miner_tx.extra;
    std::string extraAsString(reinterpret_cast(extra.data()), extra.size());

    std::string extraNonceTemplate;
    extraNonceTemplate.push_back(TX_EXTRA_NONCE);
    extraNonceTemplate.push_back(43);
    extraNonceTemplate.append(43, '\0');

    size_t extraNoncePos = extraAsString.find(extraNonceTemplate);
    if (std::string::npos == extraNoncePos) {
      std::cout << "problema1" << ENDL;
    }

    cryptonote::tx_extra_merge_mining_tag tag;
    tag.depth = 0;
    if (!cryptonote::get_block_header_hash(m_block2.block, tag.merkle_root)) {
      std::cout << "problema2" << ENDL;
    }

    std::vector extraNonceReplacement;
    if (!cryptonote::append_mm_tag_to_extra(extraNonceReplacement, tag)) {
      std::cout << "problema3" << ENDL;
    }

    if (43 < extraNonceReplacement.size()) {
      std::cout << "problema4" << ENDL;
    }

    size_t diff = extraNonceTemplate.size() - extraNonceReplacement.size();
    if (0 < diff) {
      extraNonceReplacement.push_back(TX_EXTRA_NONCE);
      extraNonceReplacement.push_back(diff - 2);
    }

    std::copy(extraNonceReplacement.begin(), extraNonceReplacement.end(), extra.begin() + extraNoncePos);
    blobdata output = block_to_blob(m_block1.block);
    Buffer* buff = Buffer::New(output.data(), output.size());
    return scope.Close(buff->handle_);
}
member
Activity: 109
Merit: 10
i have made this thing two week ago
but i have this error
"Aux block hash wasn't found in merkle tree"
member
Activity: 84
Merit: 10
I've made several commits to the open source code. The changes need to be taken by both zone117x and LucasJones

1) Major update with FCN Fantomcoin support (should be compatible with MCN Moneta Verde and any other upcoming merge mining coin)
https://github.com/LucasJones/node-cryptonote-util/pull/2
https://github.com/zone117x/node-cryptonote-pool/pull/47


2) Proper address validation for all CryptoNote coins.
https://github.com/LucasJones/node-cryptonote-util/pull/3
https://github.com/zone117x/node-cryptonote-pool/pull/48

Previously node-cryptonote-pool didn't provide proper address validation. Here are some addresses that are accepted by the pool but rejected by the wallet:

2Aui6ejTFsd11111111111111111111111111111111111111111111111111111111111111111111 11111111114W5UeV - BCN invalid but accepted address
4BKnGLZNZ5q11111111111111111111111111111111111111111111111111111111111111111111 11111111113S9JYY - XMR invalid but accepted address

Pool is checking whether the coin's address starts with a proper character, but this is an invalid rule of thumb unfortunately. The address is being created based on the currency's prefix (6 for Bytecoin, 18 for Monero), which shouldn't be confused with the address's first number. It is possible to create an address for Bytecoin with prefix 7 (and for Monero with prefix 19), which would look exactly like the two addresses above. The outcome is a potential attack on the open source pools which would freeze all payouts once the invalid address is processed by the wallet.

I've also fixed the duckNote's address validation.
member
Activity: 84
Merit: 10
We've tuned our balancing software. Xmining should be working even faster now.
Give it a try; we are waiting for your feedback!
Pages:
Jump to:
© 2020, Bitcointalksearch.org