Bitcoin Forum
April 30, 2024, 12:22:42 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3]  All
  Print  
Author Topic: Monero no wallet update since 2014, FluffyPony deleting question about it  (Read 4121 times)
fluffypony
Donator
Legendary
*
Offline Offline

Activity: 1274
Merit: 1060


GetMonero.org / MyMonero.com


View Profile WWW
July 31, 2015, 01:47:42 PM
 #41

Continuation of: Git diff from commit e940386f9a8765423ab3dd9e3aabe19a68cba9f9 (thankful_for_today's last commit) to current HEAD, excluding changes in /external so as to exclude libraries and submoduled code, and excluding contrib/ so as to exclude changes made to epee, excluding most comments because apparently nobody that writes code for BCN knows what a comment is anyway, excluding removed lines, excluding empty lines


+bool BootstrapFile::initialize_file()
+{
+  const uint32_t file_magic = blockchain_raw_magic;
+  std::string blob;
+  if (! ::serialization::dump_binary(file_magic, blob))
+  {
+    throw std::runtime_error("Error in serialization of file magic");
+  }
+  *m_raw_data_file << blob;
+  bootstrap::file_info bfi;
+  bfi.major_version = 0;
+  bfi.minor_version = 1;
+  bfi.header_size = header_size;
+  bootstrap::blocks_info bbi;
+  bbi.block_first = 0;
+  bbi.block_last = 0;
+  bbi.block_last_pos = 0;
+  buffer_type buffer2;
+  boost::iostreams::stream<boost::iostreams::back_insert_device<buffer_type>>* output_stream_header;
+  output_stream_header = new boost::iostreams::stream<boost::iostreams::back_insert_device<buffer_type>>(buffer2);
+  uint32_t bd_size = 0;
+  blobdata bd = t_serializable_object_to_blob(bfi);
+  LOG_PRINT_L1("bootstrap::file_info size: " << bd.size());
+  bd_size = bd.size();
+  if (! ::serialization::dump_binary(bd_size, blob))
+  {
+    throw std::runtime_error("Error in serialization of bootstrap::file_info size");
+  }
+  *output_stream_header << blob;
+  *output_stream_header << bd;
+  bd = t_serializable_object_to_blob(bbi);
+  LOG_PRINT_L1("bootstrap::blocks_info size: " << bd.size());
+  bd_size = bd.size();
+  if (! ::serialization::dump_binary(bd_size, blob))
+  {
+    throw std::runtime_error("Error in serialization of bootstrap::blocks_info size");
+  }
+  *output_stream_header << blob;
+  *output_stream_header << bd;
+  output_stream_header->flush();
+  *output_stream_header << std::string(header_size-buffer2.size(), 0); // fill in rest with null bytes
+  output_stream_header->flush();
+  std::copy(buffer2.begin(), buffer2.end(), std::ostreambuf_iterator<char>(*m_raw_data_file));
+  return true;
+}
+void BootstrapFile::flush_chunk()
+{
+  m_output_stream->flush();
+  uint32_t chunk_size = m_buffer.size();
+  // LOG_PRINT_L0("chunk_size " << chunk_size);
+  if (chunk_size > BUFFER_SIZE)
+  {
+    LOG_PRINT_L0("WARNING: chunk_size " << chunk_size << " > BUFFER_SIZE " << BUFFER_SIZE);
+  }
+  std::string blob;
+  if (! ::serialization::dump_binary(chunk_size, blob))
+  {
+    throw std::runtime_error("Error in serialization of chunk size");
+  }
+  *m_raw_data_file << blob;
+  if (m_max_chunk < chunk_size)
+  {
+    m_max_chunk = chunk_size;
+  }
+  long pos_before = m_raw_data_file->tellp();
+  std::copy(m_buffer.begin(), m_buffer.end(), std::ostreambuf_iterator<char>(*m_raw_data_file));
+  m_raw_data_file->flush();
+  long pos_after = m_raw_data_file->tellp();
+  long num_chars_written = pos_after - pos_before;
+  if (static_cast<unsigned long>(num_chars_written) != chunk_size)
+  {
+    LOG_PRINT_RED_L0("Error writing chunk:  height: " << m_cur_height << "  chunk_size: " << chunk_size << "  num chars written: " << num_chars_written);
+    throw std::runtime_error("Error writing chunk");
+  }
+  m_buffer.clear();
+  delete m_output_stream;
+  m_output_stream = new boost::iostreams::stream<boost::iostreams::back_insert_device<buffer_type>>(m_buffer);
+  LOG_PRINT_L1("flushed chunk:  chunk_size: " << chunk_size);
+}
+void BootstrapFile::write_block(block& block)
+{
+  bootstrap::block_package bp;
+  bp.block = block;
+  std::vector<transaction> txs;
+  uint64_t block_height = boost::get<txin_gen>(block.miner_tx.vin.front()).height;
+  // now add all regular transactions
+  for (const auto& tx_id : block.tx_hashes)
+  {
+    if (tx_id == null_hash)
+    {
+      throw std::runtime_error("Aborting: tx == null_hash");
+    }
+    const transaction* tx = m_blockchain_storage->get_tx(tx_id);
+    transaction tx = m_blockchain_storage->get_db().get_tx(tx_id);
+    if(tx == NULL)
+    {
+      if (! m_tx_pool)
+        throw std::runtime_error("Aborting: tx == NULL, so memory pool required to get tx, but memory pool isn't enabled");
+      else
+      {
+        transaction tx;
+        if(m_tx_pool->get_transaction(tx_id, tx))
+          txs.push_back(tx);
+        else
+          throw std::runtime_error("Aborting: tx not found in pool");
+      }
+    }
+    else
+      txs.push_back(*tx);
+    txs.push_back(tx);
+  }
+  // these non-coinbase txs will be serialized using this structure
+  bp.txs = txs;
+  // These three attributes are currently necessary for a fast import that adds blocks without verification.
+  bool include_extra_block_data = true;
+  if (include_extra_block_data)
+  {
+    size_t block_size = m_blockchain_storage->get_block_size(block_height);
+    difficulty_type cumulative_difficulty = m_blockchain_storage->get_block_cumulative_difficulty(block_height);
+    uint64_t coins_generated = m_blockchain_storage->get_block_coins_generated(block_height);
+    size_t block_size = m_blockchain_storage->get_db().get_block_size(block_height);
+    difficulty_type cumulative_difficulty = m_blockchain_storage->get_db().get_block_cumulative_difficulty(block_height);
+    uint64_t coins_generated = m_blockchain_storage->get_db().get_block_already_generated_coins(block_height);
+    bp.block_size = block_size;
+    bp.cumulative_difficulty = cumulative_difficulty;
+    bp.coins_generated = coins_generated;
+  }
+  blobdata bd = t_serializable_object_to_blob(bp);
+  m_output_stream->write((const char*)bd.data(), bd.size());
+}
+bool BootstrapFile::close()
+{
+  if (m_raw_data_file->fail())
+    return false;
+  m_raw_data_file->flush();
+  delete m_output_stream;
+  delete m_raw_data_file;
+  return true;
+}
+bool BootstrapFile::store_blockchain_raw(blockchain_storage* _blockchain_storage, tx_memory_pool* _tx_pool, boost::filesystem::path& output_dir, uint64_t requested_block_stop)
+bool BootstrapFile::store_blockchain_raw(Blockchain* _blockchain_storage, tx_memory_pool* _tx_pool, boost::filesystem::path& output_dir, uint64_t requested_block_stop)
+{
+  uint64_t num_blocks_written = 0;
+  m_max_chunk = 0;
+  m_blockchain_storage = _blockchain_storage;
+  m_tx_pool = _tx_pool;
+  uint64_t progress_interval = 100;
+  LOG_PRINT_L0("Storing blocks raw data...");
+  if (!BootstrapFile::open_writer(output_dir))
+  {
+    LOG_PRINT_RED_L0("failed to open raw file for write");
+    return false;
+  }
+  block b;
+  // block_start, block_stop use 0-based height. m_height uses 1-based height. So to resume export
+  // from last exported block, block_start doesn't need to add 1 here, as it's already at the next
+  // height.
+  uint64_t block_start = m_height;
+  uint64_t block_stop = 0;
+  LOG_PRINT_L0("source blockchain height: " <<  m_blockchain_storage->get_current_blockchain_height()-1);
+  if ((requested_block_stop > 0) && (requested_block_stop < m_blockchain_storage->get_current_blockchain_height()))
+  {
+    LOG_PRINT_L0("Using requested block height: " << requested_block_stop);
+    block_stop = requested_block_stop;
+  }
+  else
+  {
+    block_stop = m_blockchain_storage->get_current_blockchain_height() - 1;
+    LOG_PRINT_L0("Using block height of source blockchain: " << block_stop);
+  }
+  for (m_cur_height = block_start; m_cur_height <= block_stop; ++m_cur_height)
+  {
+    // this method's height refers to 0-based height (genesis block = height 0)
+    crypto::hash hash = m_blockchain_storage->get_block_id_by_height(m_cur_height);
+    m_blockchain_storage->get_block_by_hash(hash, b);
+    write_block(b);
+    if (m_cur_height % NUM_BLOCKS_PER_CHUNK == 0) {
+      flush_chunk();
+      num_blocks_written += NUM_BLOCKS_PER_CHUNK;
+    }
+    if (m_cur_height % progress_interval == 0) {
+      std::cout << refresh_string;
+      std::cout << "block " << m_cur_height << "/" << block_stop << std::flush;
+    }
+  }
+  // NOTE: use of NUM_BLOCKS_PER_CHUNK is a placeholder in case multi-block chunks are later supported.
+  if (m_cur_height % NUM_BLOCKS_PER_CHUNK != 0)
+  {
+    flush_chunk();
+  }
+  // print message for last block, which may not have been printed yet due to progress_interval
+  std::cout << refresh_string;
+  std::cout << "block " << m_cur_height-1 << "/" << block_stop << ENDL;
+  LOG_PRINT_L0("Number of blocks exported: " << num_blocks_written);
+  if (num_blocks_written > 0)
+    LOG_PRINT_L0("Largest chunk: " << m_max_chunk << " bytes");
+  return BootstrapFile::close();
+}
+uint64_t BootstrapFile::seek_to_first_chunk(std::ifstream& import_file)
+{
+  uint32_t file_magic;
+  std::string str1;
+  char buf1[2048];
+  import_file.read(buf1, sizeof(file_magic));
+  if (! import_file)
+    throw std::runtime_error("Error reading expected number of bytes");
+  str1.assign(buf1, sizeof(file_magic));
+  if (! ::serialization::parse_binary(str1, file_magic))
+    throw std::runtime_error("Error in deserialization of file_magic");
+  if (file_magic != blockchain_raw_magic)
+  {
+    LOG_PRINT_RED_L0("bootstrap file not recognized");
+    throw std::runtime_error("Aborting");
+  }
+  else
+    LOG_PRINT_L0("bootstrap file recognized");
+  uint32_t buflen_file_info;
+  import_file.read(buf1, sizeof(buflen_file_info));
+  str1.assign(buf1, sizeof(buflen_file_info));
+  if (! import_file)
+    throw std::runtime_error("Error reading expected number of bytes");
+  if (! ::serialization::parse_binary(str1, buflen_file_info))
+    throw std::runtime_error("Error in deserialization of buflen_file_info");
+  LOG_PRINT_L1("bootstrap::file_info size: " << buflen_file_info);
+  if (buflen_file_info > sizeof(buf1))
+    throw std::runtime_error("Error: bootstrap::file_info size exceeds buffer size");
+  import_file.read(buf1, buflen_file_info);
+  if (! import_file)
+    throw std::runtime_error("Error reading expected number of bytes");
+  str1.assign(buf1, buflen_file_info);
+  bootstrap::file_info bfi;
+  if (! ::serialization::parse_binary(str1, bfi))
+    throw std::runtime_error("Error in deserialization of bootstrap::file_info");
+  LOG_PRINT_L0("bootstrap file v" << unsigned(bfi.major_version) << "." << unsigned(bfi.minor_version));
+  LOG_PRINT_L0("bootstrap magic size: " << sizeof(file_magic));
+  LOG_PRINT_L0("bootstrap header size: " << bfi.header_size)
+  uint64_t full_header_size = sizeof(file_magic) + bfi.header_size;
+  import_file.seekg(full_header_size);
+  return full_header_size;
+}
+uint64_t BootstrapFile::count_blocks(const std::string& import_file_path)
+{
+  boost::filesystem::path raw_file_path(import_file_path);
+  boost::system::error_code ec;
+  if (!boost::filesystem::exists(raw_file_path, ec))
+  {
+    LOG_PRINT_L0("bootstrap file not found: " << raw_file_path);
+    throw std::runtime_error("Aborting");
+  }
+  std::ifstream import_file;
+  import_file.open(import_file_path, std::ios_base::binary | std::ifstream::in);
+  uint64_t h = 0;
+  if (import_file.fail())
+  {
+    LOG_PRINT_L0("import_file.open() fail");
+    throw std::runtime_error("Aborting");
+  }
+  uint64_t full_header_size; // 4 byte magic + length of header structures
+  full_header_size = seek_to_first_chunk(import_file);
+  LOG_PRINT_L0("Scanning blockchain from bootstrap file...");
+  block b;
+  bool quit = false;
+  uint64_t bytes_read = 0;
+  int progress_interval = 10;
+  std::string str1;
+  char buf1[2048];
+  while (! quit)
+  {
+    uint32_t chunk_size;
+    import_file.read(buf1, sizeof(chunk_size));
+    if (!import_file) {
+      std::cout << refresh_string;
+      LOG_PRINT_L1("End of file reached");
+      quit = true;
+      break;
+    }
+    h += NUM_BLOCKS_PER_CHUNK;
+    if ((h-1) % progress_interval == 0)
+    {
+      std::cout << "\r" << "block height: " << h-1 <<
+        "    " <<
+        std::flush;
+    }
+    bytes_read += sizeof(chunk_size);
+    str1.assign(buf1, sizeof(chunk_size));
+    if (! ::serialization::parse_binary(str1, chunk_size))
+      throw std::runtime_error("Error in deserialization of chunk_size");
+    LOG_PRINT_L3("chunk_size: " << chunk_size);
+    if (chunk_size > BUFFER_SIZE)
+    {
+      std::cout << refresh_string;
+      LOG_PRINT_L0("WARNING: chunk_size " << chunk_size << " > BUFFER_SIZE " << BUFFER_SIZE
+          << "  height: " << h-1);
+      throw std::runtime_error("Aborting: chunk size exceeds buffer size");
+    }
+    if (chunk_size > 100000)
+    {
+      std::cout << refresh_string;
+      LOG_PRINT_L0("NOTE: chunk_size " << chunk_size << " > 100000" << "  height: "
+          << h-1);
+    }
+    else if (chunk_size <= 0) {
+      std::cout << refresh_string;
+      LOG_PRINT_L0("ERROR: chunk_size " << chunk_size << " <= 0" << "  height: " << h-1);
+      throw std::runtime_error("Aborting");
+    }
+    // skip to next expected block size value
+    import_file.seekg(chunk_size, std::ios_base::cur);
+    if (! import_file) {
+      std::cout << refresh_string;
+      LOG_PRINT_L0("ERROR: unexpected end of file: bytes read before error: "
+          << import_file.gcount() << " of chunk_size " << chunk_size);
+      throw std::runtime_error("Aborting");
+    }
+    bytes_read += chunk_size;
+    // std::cout << refresh_string;
+    LOG_PRINT_L3("Number bytes scanned: " << bytes_read);
+  }
+  import_file.close();
+  std::cout << ENDL;
+  std::cout << "Done scanning bootstrap file" << ENDL;
+  std::cout << "Full header length: " << full_header_size << " bytes" << ENDL;
+  std::cout << "Scanned for blocks: " << bytes_read << " bytes" << ENDL;
+  std::cout << "Total:              " << full_header_size + bytes_read << " bytes" << ENDL;
+  std::cout << "Number of blocks: " << h << ENDL;
+  std::cout << ENDL;
+  // NOTE: h is the number of blocks.
+  // Note that a block's stored height is zero-based, but parts of the code use
+  // one-based height.
+  return h;
+}
diff --git a/src/blockchain_utilities/bootstrap_file.h b/src/blockchain_utilities/bootstrap_file.h
new file mode 100644
index 0000000..5fb8a1d
+++ b/src/blockchain_utilities/bootstrap_file.h
@@ -0,0 +1,116 @@
+using namespace cryptonote;
+class BootstrapFile
+{
+public:
+  uint64_t count_blocks(const std::string& dir_path);
+  uint64_t seek_to_first_chunk(std::ifstream& import_file);
+  bool store_blockchain_raw(cryptonote::blockchain_storage* cs, cryptonote::tx_memory_pool* txp,
+      boost::filesystem::path& output_dir, uint64_t use_block_height=0);
+  bool store_blockchain_raw(cryptonote::Blockchain* cs, cryptonote::tx_memory_pool* txp,
+      boost::filesystem::path& output_dir, uint64_t use_block_height=0);
+protected:
+  blockchain_storage* m_blockchain_storage;
+  Blockchain* m_blockchain_storage;
+  tx_memory_pool* m_tx_pool;
+  typedef std::vector<char> buffer_type;
+  std::ofstream * m_raw_data_file;
+  buffer_type m_buffer;
+  boost::iostreams::stream<boost::iostreams::back_insert_device<buffer_type>>* m_output_stream;
+  // open export file for write
+  bool open_writer(const boost::filesystem::path& dir_path);
+  bool initialize_file();
+  bool close();
+  void write_block(block& block);
+  void flush_chunk();
+private:
+  uint64_t m_height;
+  uint64_t m_cur_height; // tracks current height during export
+  uint32_t m_max_chunk;
+};
diff --git a/src/blockchain_utilities/bootstrap_serialization.h b/src/blockchain_utilities/bootstrap_serialization.h
new file mode 100644
index 0000000..6fa9493
+++ b/src/blockchain_utilities/bootstrap_serialization.h
@@ -0,0 +1,88 @@
+namespace cryptonote
+{
+  namespace bootstrap
+  {
+    struct file_info
+    {
+      uint8_t  major_version;
+      uint8_t  minor_version;
+      uint32_t header_size;
+      BEGIN_SERIALIZE_OBJECT()
+        FIELD(major_version);
+        FIELD(minor_version);
+        VARINT_FIELD(header_size);
+      END_SERIALIZE()
+    };
+    struct blocks_info
+    {
+      // block heights of file's first and last blocks, zero-based indexes
+      uint64_t block_first;
+      uint64_t block_last;
+      // file position, for directly reading last block
+      uint64_t block_last_pos;
+      BEGIN_SERIALIZE_OBJECT()
+        VARINT_FIELD(block_first);
+        VARINT_FIELD(block_last);
+        VARINT_FIELD(block_last_pos);
+      END_SERIALIZE()
+    };
+    struct block_package
+    {
+      cryptonote::block block;
+      std::vector<transaction> txs;
+      size_t block_size;
+      difficulty_type cumulative_difficulty;
+      uint64_t coins_generated;
+      BEGIN_SERIALIZE()
+        FIELD(block)
+        FIELD(txs)
+        VARINT_FIELD(block_size)
+        VARINT_FIELD(cumulative_difficulty)
+        VARINT_FIELD(coins_generated)
+      END_SERIALIZE()
+    };
+  }
+}
diff --git a/src/blockchain_utilities/fake_core.h b/src/blockchain_utilities/fake_core.h
new file mode 100644
index 0000000..5eda504
+++ b/src/blockchain_utilities/fake_core.h
@@ -0,0 +1,165 @@
+using namespace cryptonote;
+struct fake_core_lmdb
+{
+  Blockchain m_storage;
+  tx_memory_pool m_pool;
+  bool support_batch;
+  bool support_add_block;
+  // for multi_db_runtime:
+  fake_core_lmdb(const boost::filesystem::path &path, const bool use_testnet=false, const bool do_batch=true, const int mdb_flags=0) : m_pool(&m_storage), m_storage(m_pool)
+  // for multi_db_compile:
+  fake_core_lmdb(const boost::filesystem::path &path, const bool use_testnet=false, const bool do_batch=true, const int mdb_flags=0) : m_pool(m_storage), m_storage(m_pool)
+  {
+    m_pool.init(path.string());
+    BlockchainDB* db = new BlockchainLMDB();
+    boost::filesystem::path folder(path);
+    folder /= db->get_db_name();
+    LOG_PRINT_L0("Loading blockchain from folder " << folder.string() << " ...");
+    const std::string filename = folder.string();
+    try
+    {
+      db->open(filename, mdb_flags);
+    }
+    catch (const std::exception& e)
+    {
+      LOG_PRINT_L0("Error opening database: " << e.what());
+      throw;
+    }
+    m_storage.init(db, use_testnet);
+    if (do_batch)
+      m_storage.get_db().set_batch_transactions(do_batch);
+    support_batch = true;
+    support_add_block = true;
+  }
+  ~fake_core_lmdb()
+  {
+    m_storage.deinit();
+  }
+  uint64_t add_block(const block& blk
+                            , const size_t& block_size
+                            , const difficulty_type& cumulative_difficulty
+                            , const uint64_t& coins_generated
+                            , const std::vector<transaction>& txs
+                            )
+  {
+    return m_storage.get_db().add_block(blk, block_size, cumulative_difficulty, coins_generated, txs);
+  }
+  void batch_start(uint64_t batch_num_blocks = 0)
+  {
+    m_storage.get_db().batch_start(batch_num_blocks);
+  }
+  void batch_stop()
+  {
+    m_storage.get_db().batch_stop();
+  }
+};
+struct fake_core_memory
+{
+  blockchain_storage m_storage;
+  tx_memory_pool m_pool;
+  bool support_batch;
+  bool support_add_block;
+  // for multi_db_runtime:
+  fake_core_memory(const boost::filesystem::path &path, const bool use_testnet=false) : m_pool(&m_storage), m_storage(m_pool)
+  // for multi_db_compile:
+  fake_core_memory(const boost::filesystem::path &path, const bool use_testnet=false) : m_pool(m_storage), m_storage(&m_pool)
+  {
+    m_pool.init(path.string());
+    m_storage.init(path.string(), use_testnet);
+    support_batch = false;
+    support_add_block = false;
+  }
+  ~fake_core_memory()
+  {
+    LOG_PRINT_L3("fake_core_memory() destructor called - want to see it ripple down");
+    m_storage.deinit();
+  }
+  uint64_t add_block(const block& blk
+                            , const size_t& block_size
+                            , const difficulty_type& cumulative_difficulty
+                            , const uint64_t& coins_generated
+                            , const std::vector<transaction>& txs
+                            )
+  {
+    // TODO:
+    // would need to refactor handle_block_to_main_chain() to have a direct add_block() method like Blockchain class
+    throw std::runtime_error("direct add_block() method not implemented for in-memory db");
+    return 2;
+  }
+  void batch_start(uint64_t batch_num_blocks = 0)
+  {
+    LOG_PRINT_L0("WARNING: [batch_start] opt_batch set, but this database doesn't support/need transactions - ignoring");
+  }
+  void batch_stop()
+  {
+    LOG_PRINT_L0("WARNING: [batch_stop] opt_batch set, but this database doesn't support/need transactions - ignoring");
+  }
+};
diff --git a/src/blocks/CMakeLists.txt b/src/blocks/CMakeLists.txt
new file mode 100644
index 0000000..4020132
+++ b/src/blocks/CMakeLists.txt
@@ -0,0 +1,38 @@
+if(APPLE)
+    add_library(blocks STATIC blockexports.c)
+    set_target_properties(blocks PROPERTIES LINKER_LANGUAGE C)
+else()
+   add_custom_command(OUTPUT blocks.o COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && ld -r -b binary -o ${CMAKE_CURRENT_BINARY_DIR}/blocks.o blocks.dat)
+    add_library(blocks STATIC blocks.o blockexports.c)
+    set_target_properties(blocks PROPERTIES LINKER_LANGUAGE C)
+endif()
diff --git a/src/blocks/blockexports.c b/src/blocks/blockexports.c
new file mode 100644
index 0000000..cea72b2
+++ b/src/blocks/blockexports.c
@@ -0,0 +1,48 @@
+extern const struct mach_header _mh_execute_header;
+extern const struct mach_header_64 _mh_execute_header;
+const unsigned char *get_blocks_dat_start()
+{
+    size_t size;
+    return getsectiondata(&_mh_execute_header, "__DATA", "__blocks_dat", &size);
+}
+size_t get_blocks_dat_size()
+{
+    size_t size;
+    getsectiondata(&_mh_execute_header, "__DATA", "__blocks_dat", &size);
+    return size;
+}
+extern const unsigned char _binary_blocks_start[];
+extern const unsigned char _binary_blocks_end[];
+const unsigned char *get_blocks_dat_start(void)
+{
+   return _binary_blocks_start;
+}
+size_t get_blocks_dat_size(void)
+{
+   return (size_t) (_binary_blocks_end - _binary_blocks_start);
+}
diff --git a/src/blocks/blocks.dat b/src/blocks/blocks.dat
new file mode 100644
index 0000000..e69de29
diff --git a/src/blocks/blocks.h b/src/blocks/blocks.h
new file mode 100644
index 0000000..76a08c8
+++ b/src/blocks/blocks.h
@@ -0,0 +1,16 @@
+extern "C" {
+const unsigned char *get_blocks_dat_start();
+size_t get_blocks_dat_size();
+}
diff --git a/src/blocks/checkpoints.dat b/src/blocks/checkpoints.dat
new file mode 100644
index 0000000..249956e
Binary files /dev/null and b/src/blocks/checkpoints.dat differ
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
new file mode 100644
index 0000000..b1db006
+++ b/src/common/CMakeLists.txt
@@ -0,0 +1,69 @@
+set(common_sources
+  base58.cpp
+  command_line.cpp
+  dns_utils.cpp
+  util.cpp
+  i18n.cpp)
+set(common_headers)
+set(common_private_headers
+  base58.h
+  boost_serialization_helper.h
+  command_line.h
+  dns_utils.h
+  http_connection.h
+  int-util.h
+  pod-class.h
+  rpc_client.h
+  scoped_message_writer.h
+  unordered_containers_boost_serialization.h
+  util.h
+  varint.h
+  i18n.h)
+bitmonero_private_headers(common
+  ${common_private_headers})
+bitmonero_add_library(common
+  ${common_sources}
+  ${common_headers}
+  ${common_private_headers})
+target_link_libraries(common
+  LINK_PRIVATE
+    crypto
+    ${UNBOUND_LIBRARY}
+    ${Boost_DATE_TIME_LIBRARY}
+    ${Boost_FILESYSTEM_LIBRARY}
+    ${Boost_SYSTEM_LIBRARY}
+    ${EXTRA_LIBRARIES})
diff --git a/src/common/base58.cpp b/src/common/base58.cpp
index 454c0db..6adc46c 100644
+++ b/src/common/base58.cpp
@@ -1,7 +1,32 @@
 #include "base58.h"
@@ -110,7 +135,7 @@ namespace tools
       void encode_block(const char* block, size_t size, char* res)
       {
+        assert(1 <= size && size <= full_block_size);
         uint64_t num = uint_8be_to_64(reinterpret_cast<const uint8_t*>(block), size);
         int i = static_cast<int>(encoded_block_sizes[size]) - 1;
diff --git a/src/common/base58.h b/src/common/base58.h
index 4055f62..1a9ad1a 100644
+++ b/src/common/base58.h
@@ -1,6 +1,32 @@
 #pragma once
diff --git a/src/common/boost_serialization_helper.h b/src/common/boost_serialization_helper.h
index 74016ae..c108c52 100644
+++ b/src/common/boost_serialization_helper.h
@@ -1,6 +1,32 @@
 #pragma once
@@ -14,15 +40,55 @@ namespace tools
   bool serialize_obj_to_file(t_object& obj, const std::string& file_path)
   {
     TRY_ENTRY();
+    // Need to know HANDLE of file to call FlushFileBuffers
+    HANDLE data_file_handle = ::CreateFile(file_path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+    if (INVALID_HANDLE_VALUE == data_file_handle)
+      return false;
+    int data_file_descriptor = _open_osfhandle((intptr_t)data_file_handle, 0);
+    if (-1 == data_file_descriptor)
+    {
+      ::CloseHandle(data_file_handle);
+      return false;
+    }
+    FILE* data_file_file = _fdopen(data_file_descriptor, "wb");
+    if (0 == data_file_file)
+    {
+      // Call CloseHandle is not necessary
+      _close(data_file_descriptor);
+      return false;
+    }
+    // HACK: undocumented constructor, this code may not compile
+    std::ofstream data_file(data_file_file);
+    if (data_file.fail())
+    {
+      // Call CloseHandle and _close are not necessary
+      fclose(data_file_file);
+      return false;
+    }
     std::ofstream data_file;
+    data_file.open(file_path , std::ios_base::binary | std::ios_base::out| std::ios::trunc);
+    if (data_file.fail())
       return false;
     boost::archive::binary_oarchive a(data_file);
     a << obj;
+    if (data_file.fail())
+      return false;
+    data_file.flush();
+    // To make sure the file is fully stored on disk
+    ::FlushFileBuffers(data_file_handle);
+    fclose(data_file_file);
+    return true;
     CATCH_ENTRY_L0("serialize_obj_to_file", false);
   }
diff --git a/src/common/command_line.cpp b/src/common/command_line.cpp
index 0b90345..d2cd75e 100644
+++ b/src/common/command_line.cpp
@@ -1,12 +1,54 @@
 #include "command_line.h"
 namespace command_line
 {
+  std::string input_line(const std::string& prompt)
+  {
+    std::cout << prompt;
+    std::string buf;
+    std::getline(std::cin, buf);
+    return epee::string_tools::trim(buf);
+  }
   const arg_descriptor<bool> arg_help = {"help", "Produce help message"};
   const arg_descriptor<bool> arg_version = {"version", "Output version information"};
   const arg_descriptor<std::string> arg_data_dir = {"data-dir", "Specify data directory"};
+  const arg_descriptor<std::string> arg_testnet_data_dir = {"testnet-data-dir", "Specify testnet data directory"};
+  const arg_descriptor<bool>      arg_test_drop_download        = {"test-drop-download", "For net tests: in download, discard ALL blocks instead checking/saving them (very fast)"};
+  const arg_descriptor<uint64_t>   arg_test_drop_download_height     = {"test-drop-download-height", "Like test-drop-download but disards only after around certain height", 0};
+  const arg_descriptor<int>       arg_test_dbg_lock_sleep = {"test-dbg-lock-sleep", "Sleep time in ms, defaults to 0 (off), used to debug before/after locking mutex. Values 100 to 1000 are good for tests."};
 }
diff --git a/src/common/command_line.h b/src/common/command_line.h
index 8606537..ae79f0a 100644
+++ b/src/common/command_line.h
@@ -1,6 +1,32 @@
 #pragma once
@@ -14,6 +40,9 @@
 namespace command_line
 {
+  std::string input_line(const std::string& prompt);
   template<typename T, bool required = false>
   struct arg_descriptor;
@@ -174,4 +203,8 @@ namespace command_line
   extern const arg_descriptor<bool> arg_help;
   extern const arg_descriptor<bool> arg_version;
   extern const arg_descriptor<std::string> arg_data_dir;
+  extern const arg_descriptor<std::string> arg_testnet_data_dir;
+  extern const arg_descriptor<bool>      arg_test_drop_download;
+  extern const arg_descriptor<uint64_t>   arg_test_drop_download_height;
+  extern const arg_descriptor<int>       arg_test_dbg_lock_sleep;
 }
diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp
new file mode 100644
index 0000000..e442d3d
+++ b/src/common/dns_utils.cpp
@@ -0,0 +1,347 @@
+using namespace epee;
+namespace bf = boost::filesystem;
+namespace
+{
+/*
+ * The following two functions were taken from unbound-anchor.c, from
+ * the unbound library packaged with this source.  The license and source
+ * can be found in $PROJECT_ROOT/external/unbound
+ */
+/* Cert builtin commented out until it's used, as the compiler complains
+static const char*
+get_builtin_cert(void)
+{
+   return
+"-----BEGIN CERTIFICATE-----\n"
+"MIIDdzCCAl+gAwIBAgIBATANBgkqhkiG9w0BAQsFADBdMQ4wDAYDVQQKEwVJQ0FO\n"
+"TjEmMCQGA1UECxMdSUNBTk4gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxFjAUBgNV\n"
+"BAMTDUlDQU5OIFJvb3QgQ0ExCzAJBgNVBAYTAlVTMB4XDTA5MTIyMzA0MTkxMloX\n"
+"DTI5MTIxODA0MTkxMlowXTEOMAwGA1UEChMFSUNBTk4xJjAkBgNVBAsTHUlDQU5O\n"
+"IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRYwFAYDVQQDEw1JQ0FOTiBSb290IENB\n"
+"MQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKDb\n"
+"cLhPNNqc1NB+u+oVvOnJESofYS9qub0/PXagmgr37pNublVThIzyLPGCJ8gPms9S\n"
+"G1TaKNIsMI7d+5IgMy3WyPEOECGIcfqEIktdR1YWfJufXcMReZwU4v/AdKzdOdfg\n"
+"ONiwc6r70duEr1IiqPbVm5T05l1e6D+HkAvHGnf1LtOPGs4CHQdpIUcy2kauAEy2\n"
+"paKcOcHASvbTHK7TbbvHGPB+7faAztABLoneErruEcumetcNfPMIjXKdv1V1E3C7\n"
+"MSJKy+jAqqQJqjZoQGB0necZgUMiUv7JK1IPQRM2CXJllcyJrm9WFxY0c1KjBO29\n"
+"iIKK69fcglKcBuFShUECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B\n"
+"Af8EBAMCAf4wHQYDVR0OBBYEFLpS6UmDJIZSL8eZzfyNa2kITcBQMA0GCSqGSIb3\n"
+"DQEBCwUAA4IBAQAP8emCogqHny2UYFqywEuhLys7R9UKmYY4suzGO4nkbgfPFMfH\n"
+"6M+Zj6owwxlwueZt1j/IaCayoKU3QsrYYoDRolpILh+FPwx7wseUEV8ZKpWsoDoD\n"
+"2JFbLg2cfB8u/OlE4RYmcxxFSmXBg0yQ8/IoQt/bxOcEEhhiQ168H2yE5rxJMt9h\n"
+"15nu5JBSewrCkYqYYmaxyOC3WrVGfHZxVI7MpIFcGdvSb2a1uyuua8l0BKgk3ujF\n"
+"0/wsHNeP22qNyVO+XVBzrM8fk8BSUFuiT/6tZTYXRtEt5aKQZgXbKU5dUF3jT9qg\n"
+"j/Br5BZw3X/zd325TvnswzMC1+ljLzHnQGGk\n"
+"-----END CERTIFICATE-----\n"
+      ;
+}
+*/
+/** return the built in root DS trust anchor */
+static const char*
+get_builtin_ds(void)
+{
+   return
+". IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5\n";
+}
+/************************************************************
+ ************************************************************
+ ***********************************************************/
+} // anonymous namespace
+namespace tools
+{
+std::string ipv4_to_string(const char* src)
+{
+  std::stringstream ss;
+  unsigned int bytes[4];
+  for (int i = 0; i < 4; i++)
+  {
+    unsigned char a = src;
+    bytes = a;
+  }
+  ss << bytes[0] << "."
+     << bytes[1] << "."
+     << bytes[2] << "."
+     << bytes[3];
+  return ss.str();
+}
+std::string ipv6_to_string(const char* src)
+{
+  std::stringstream ss;
+  unsigned int bytes[8];
+  for (int i = 0; i < 8; i++)
+  {
+    unsigned char a = src;
+    bytes = a;
+  }
+  ss << bytes[0] << ":"
+     << bytes[1] << ":"
+     << bytes[2] << ":"
+     << bytes[3] << ":"
+     << bytes[4] << ":"
+     << bytes[5] << ":"
+     << bytes[6] << ":"
+     << bytes[7];
+  return ss.str();
+}
+template<typename type, void (*freefunc)(type*)>
+class scoped_ptr
+{
+public:
+  scoped_ptr():
+    ptr(nullptr)
+  {
+  }
+  scoped_ptr(type *p):
+    ptr(p)
+  {
+  }
+  ~scoped_ptr()
+  {
+    freefunc(ptr);
+  }
+  operator type *() { return ptr; }
+  type **operator &() { return &ptr; }
+  type *operator->() { return ptr; }
+  operator const type*() const { return &ptr; }
+private:
+  type* ptr;
+};
+typedef class scoped_ptr<ub_result,ub_resolve_free> ub_result_ptr;
+static void freestring(char *ptr) { free(ptr); }
+typedef class scoped_ptr<char,freestring> string_ptr;
+struct DNSResolverData
+{
+  ub_ctx* m_ub_context;
+};
+DNSResolver::DNSResolver() : m_data(new DNSResolverData())
+{
+  // init libunbound context
+  m_data->m_ub_context = ub_ctx_create();
+  // look for "/etc/resolv.conf" and "/etc/hosts" or platform equivalent
+  ub_ctx_resolvconf(m_data->m_ub_context, NULL);
+  ub_ctx_hosts(m_data->m_ub_context, NULL);
+   #ifdef DEVELOPER_LIBUNBOUND_OLD
+      #pragma message "Using the work around for old libunbound"
+      { // work around for bug https://www.nlnetlabs.nl/bugs-script/show_bug.cgi?id=515 needed for it to compile on e.g. Debian 7
+         char * ds_copy = NULL; // this will be the writable copy of string that bugged version of libunbound requires
+         try {
+            char * ds_copy = strdup( ::get_builtin_ds() );
+            ub_ctx_add_ta(m_data->m_ub_context, ds_copy);
+         } catch(...) { // probably not needed but to work correctly in every case...
+            if (ds_copy) { free(ds_copy); ds_copy=NULL; } // for the strdup
+            throw ;
+         }
+         if (ds_copy) { free(ds_copy); ds_copy=NULL; } // for the strdup
+      }
+   #else
+      // normal version for fixed libunbound
+      ub_ctx_add_ta(m_data->m_ub_context, ::get_builtin_ds() );
+   #endif
+}
+DNSResolver::~DNSResolver()
+{
+  if (m_data)
+  {
+    if (m_data->m_ub_context != NULL)
+    {
+      ub_ctx_delete(m_data->m_ub_context);
+    }
+    delete m_data;
+  }
+}
+std::vector<std::string> DNSResolver::get_ipv4(const std::string& url, bool& dnssec_available, bool& dnssec_valid)
+{
+  std::vector<std::string> addresses;
+  dnssec_available = false;
+  dnssec_valid = false;
+  string_ptr urlC(strdup(url.c_str()));
+  if (!check_address_syntax(urlC))
+  {
+    return addresses;
+  }
+  // destructor takes care of cleanup
+  ub_result_ptr result;
+  // call DNS resolver, blocking.  if return value not zero, something went wrong
+  if (!ub_resolve(m_data->m_ub_context, urlC, DNS_TYPE_A, DNS_CLASS_IN, &result))
+  {
+    dnssec_available = (result->secure || (!result->secure && result->bogus));
+    dnssec_valid = result->secure && !result->bogus;
+    if (result->havedata)
+    {
+      for (size_t i=0; result->data != NULL; i++)
+      {
+        addresses.push_back(ipv4_to_string(result->data));
+      }
+    }
+  }
+  return addresses;
+}
+std::vector<std::string> DNSResolver::get_ipv6(const std::string& url, bool& dnssec_available, bool& dnssec_valid)
+{
+  std::vector<std::string> addresses;
+  dnssec_available = false;
+  dnssec_valid = false;
+  string_ptr urlC(strdup(url.c_str()));
+  if (!check_address_syntax(urlC))
+  {
+    return addresses;
+  }
+  ub_result_ptr result;
+  // call DNS resolver, blocking.  if return value not zero, something went wrong
+  if (!ub_resolve(m_data->m_ub_context, urlC, DNS_TYPE_AAAA, DNS_CLASS_IN, &result))
+  {
+    dnssec_available = (result->secure || (!result->secure && result->bogus));
+    dnssec_valid = result->secure && !result->bogus;
+    if (result->havedata)
+    {
+      for (size_t i=0; result->data != NULL; i++)
+      {
+        addresses.push_back(ipv6_to_string(result->data));
+      }
+    }
+  }
+  return addresses;
+}
+std::vector<std::string> DNSResolver::get_txt_record(const std::string& url, bool& dnssec_available, bool& dnssec_valid)
+{
+  std::vector<std::string> records;
+  dnssec_available = false;
+  dnssec_valid = false;
+  string_ptr urlC(strdup(url.c_str()));
+  if (!check_address_syntax(urlC))
+  {
+    return records;
+  }
+  ub_result_ptr result;
+  // call DNS resolver, blocking.  if return value not zero, something went wrong
+  if (!ub_resolve(m_data->m_ub_context, urlC, DNS_TYPE_TXT, DNS_CLASS_IN, &result))
+  {
+    dnssec_available = (result->secure || (!result->secure && result->bogus));
+    dnssec_valid = result->secure && !result->bogus;
+    if (result->havedata)
+    {
+      for (size_t i=0; result->data != NULL; i++)
+      {
+         // plz fix this, but this does NOT work and spills over into parts of memory it shouldn't: records.push_back(result.ptr->data);
+        char *restxt;
+        restxt = (char*) calloc(result->len+1, 1);
+        memcpy(restxt, result->data+1, result->len-1);
+        records.push_back(restxt);
+      }
+    }
+  }
+  return records;
+}
+std::string DNSResolver::get_dns_format_from_oa_address(const std::string& oa_addr)
+{
+  std::string addr(oa_addr);
+  auto first_at = addr.find("@");
+  if (first_at == std::string::npos)
+    return addr;
+  // convert name@domain.tld to name.domain.tld
+  addr.replace(first_at, 1, ".");
+  return addr;
+}
+DNSResolver& DNSResolver::instance()
+{
+  static DNSResolver* staticInstance = NULL;
+  if (staticInstance == NULL)
+  {
+    staticInstance = new DNSResolver();
+  }
+  return *staticInstance;
+}
+bool DNSResolver::check_address_syntax(const char *addr)
+{
+  // if string doesn't contain a dot, we won't consider it a url for now.
+  if (strchr(addr,'.') == NULL)
+  {
+    return false;
+  }
+  return true;
+}
+}  // namespace tools
diff --git a/src/common/dns_utils.h b/src/common/dns_utils.h
new file mode 100644
index 0000000..1e726c8
+++ b/src/common/dns_utils.h
@@ -0,0 +1,136 @@
+namespace tools
+{
+const static int DNS_CLASS_IN  = 1;
+const static int DNS_TYPE_A    = 1;
+const static int DNS_TYPE_TXT  = 16;
+const static int DNS_TYPE_AAAA = 8;
+struct DNSResolverData;
+/**
+ * @brief Provides high-level access to DNS resolution
+ *
+ * This class is designed to provide a high-level abstraction to DNS resolution
+ * functionality, including access to TXT records and such.  It will also
+ * handle DNSSEC validation of the results.
+ */
+class DNSResolver
+{
+public:
+  /**
+   * @brief Constructs an instance of DNSResolver
+   *
+   * Constructs a class instance and does setup stuff for the backend resolver.
+   */
+  DNSResolver();
+  /**
+   * @brief takes care of freeing C pointers and such
+   */
+  ~DNSResolver();
+  /**
+   * @brief gets ipv4 addresses from DNS query of a URL
+   *
+   * returns a vector of all IPv4 "A" records for given URL.
+   * If no "A" records found, returns an empty vector.
+   *
+   * @param url A string containing a URL to query for
+   *
+   * @param dnssec_available
+   *
+   * @return vector of strings containing ipv4 addresses
+   */
+  std::vector<std::string> get_ipv4(const std::string& url, bool& dnssec_available, bool& dnssec_valid);
+  /**
+   * @brief gets ipv6 addresses from DNS query
+   *
+   * returns a vector of all IPv6 "A" records for given URL.
+   * If no "A" records found, returns an empty vector.
+   *
+   * @param url A string containing a URL to query for
+   *
+   * @return vector of strings containing ipv6 addresses
+   */
+   std::vector<std::string> get_ipv6(const std::string& url, bool& dnssec_available, bool& dnssec_valid);
+  /**
+   * @brief gets all TXT records from a DNS query for the supplied URL;
+   * if no TXT record present returns an empty vector.
+   *
+   * @param url A string containing a URL to query for
+   *
+   * @return A vector of strings containing a TXT record; or an empty vector
+   */
+  // TODO: modify this to accomodate DNSSEC
+   std::vector<std::string> get_txt_record(const std::string& url, bool& dnssec_available, bool& dnssec_valid);
+  /**
+   * @brief Gets a DNS address from OpenAlias format
+   *
+   * If the address looks good, but contains one @ symbol, replace that with a .
+   * e.g. donate@getmonero.org becomes donate.getmonero.org
+   *
+   * @param oa_addr  OpenAlias address
+   *
+   * @return dns_addr  DNS address
+   */
+  std::string get_dns_format_from_oa_address(const std::string& oa_addr);
+  /**
+   * @brief Gets the singleton instance of DNSResolver
+   *
+   * @return returns a pointer to the singleton
+   */
+  static DNSResolver& instance();
+private:
+  /**
+   * @brief Checks a string to see if it looks like a URL
+   *
+   * @param addr the string to be checked
+   *
+   * @return true if it looks enough like a URL, false if not
+   */
+  bool check_address_syntax(const char *addr);
+  DNSResolverData *m_data;
+}; // class DNSResolver
+}  // namespace tools
diff --git a/src/common/http_connection.h b/src/common/http_connection.h
new file mode 100644
index 0000000..c192e79

1714479762
Hero Member
*
Offline Offline

Posts: 1714479762

View Profile Personal Message (Offline)

Ignore
1714479762
Reply with quote  #2

1714479762
Report to moderator
"I'm sure that in 20 years there will either be very large transaction volume or no volume." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714479762
Hero Member
*
Offline Offline

Posts: 1714479762

View Profile Personal Message (Offline)

Ignore
1714479762
Reply with quote  #2

1714479762
Report to moderator
1714479762
Hero Member
*
Offline Offline

Posts: 1714479762

View Profile Personal Message (Offline)

Ignore
1714479762
Reply with quote  #2

1714479762
Report to moderator
1714479762
Hero Member
*
Offline Offline

Posts: 1714479762

View Profile Personal Message (Offline)

Ignore
1714479762
Reply with quote  #2

1714479762
Report to moderator
fluffypony
Donator
Legendary
*
Offline Offline

Activity: 1274
Merit: 1060


GetMonero.org / MyMonero.com


View Profile WWW
July 31, 2015, 01:48:41 PM
 #42

I've got like another 40 posts to go, but I'm going to take a break for a few minutes and let you think about your life.

DonYo
Sr. Member
****
Offline Offline

Activity: 432
Merit: 251


View Profile
July 31, 2015, 01:50:11 PM
 #43





██████████
█████████████████
██████████████████████
█████████████████████████
████████████████████████████
████
████████████████████████
█████
███████████████████████████
█████
███████████████████████████
██████
████████████████████████████
██████
████████████████████████████
██████
████████████████████████████
██████
███████████████████████████
██████
██████████████████████████
█████
███████████████████████████
█████████████
██████████████
████████████████████████████
█████████████████████████
██████████████████████
█████████████████
██████████

Monero
"The difference between bad and well-developed digital cash will determine
whether we have a dictatorship or a real democracy." 
David Chaum 1996
"Fungibility provides privacy as a side effect."  Adam Back 2014
Buy and sell XMR near you
P2P Exchange Network
Buy XMR with fiat
esoum.1003
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
July 31, 2015, 01:57:20 PM
 #44


Did you stop copy paste your straw?

Please comment the post.

Please compare development of monero with the development of the fathers of the code that your coin uses, ups, sorry, this project was stolen from T_F_T.

Yes, thats when you scammers started. You Trolleros Devs couldn't even create a genesis block, so you stole the project from T_F_T.

Look what another dev think of your work, 6 months ago, and Monero did not change a thing since then.


As for me - monero is a biggest bubble, because there is only speculation about it, blockchain is unusable with its size, IMO almost everything about monero seems terrible - unusable blockchain size (On average PC, it just can`t be a network node), block intervals, tx generation size,  fee size, no GUI after almost 1 year since start,  totally wrong way of development, looks like just no understanding of CN technology.

"software development and infrastructure creation that is done by The Monero Project. " lol you are confirming my words - XRM devs can`t develop the coin, because of low technology understanding, they just make some poor services around original source code, like closed source web wallets.
There is nothing that monero gives to cryptocurrency world, except the wrong way in understanding the new technology, such a pity.
pandher
Legendary
*
Offline Offline

Activity: 952
Merit: 1000


Stagnation is Death


View Profile WWW
July 31, 2015, 02:05:19 PM
 #45

I am pretty darn sure that esoum and dukey are the BCN scammers, the energy and aggressiveness these accounts have to keep bad mouthing Monero is a clear sign. I remember when these guys unleashed the last shit storm we started seeing newbie accounts never seen before.

I have started to remember the Dash guys and general troll folks  Cheesy but these are clearly agenda driven newbie campaigners from the BCN criminal group
G2M
Sr. Member
****
Offline Offline

Activity: 280
Merit: 250


Activity: 616


View Profile
July 31, 2015, 02:07:17 PM
 #46

AKA redletter bandits

Wind picked up: F4BC1F4BC0A2A1C4

banditryandloot goin2mars kbm keyboard-mash theusualstuff

probably a few more that don't matter for much.
esoum.1003
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
July 31, 2015, 02:22:56 PM
 #47

I am pretty darn sure that esoum and dukey are the BCN scammers, the energy and aggressiveness these accounts have to keep bad mouthing Monero is a clear sign. I remember when these guys unleashed the last shit storm we started seeing newbie accounts never seen before.

I have started to remember the Dash guys and general troll folks  Cheesy but these are clearly agenda driven newbie campaigners from the BCN criminal group

You are so lost, my friend ...

You can´t see what is goin on, do you....

Everything that i have said is true, like monero dev smooth says, i feel the obligation of clarifying the new users of this forum.

Why doesn't Trolleros get a forum? Like any respectable coin with a community, probably they don't have such community?
fluffypony
Donator
Legendary
*
Offline Offline

Activity: 1274
Merit: 1060


GetMonero.org / MyMonero.com


View Profile WWW
July 31, 2015, 03:53:38 PM
 #48

Why doesn't Trolleros get a forum? Like any respectable coin with a community, probably they don't have such community?

...

You're not a very bright scammer, are you.

https://forum.getmonero.org

fluffypony
Donator
Legendary
*
Offline Offline

Activity: 1274
Merit: 1060


GetMonero.org / MyMonero.com


View Profile WWW
July 31, 2015, 03:55:11 PM
 #49

Monero was always a junkcoin, all they did was hype up the price and then sell their bag.
The manipulated volume on Poloniex alone should tell you to stay away from this scam.

Are you still flogging the same horse? I used to pity you, thinking that you were maybe just a sad loser desperately vying for relevance on an unimportant forum in a corner of the Internet, but now I see you're nothing more than a common troll. So sad, so sad.

smooth
Legendary
*
Offline Offline

Activity: 2968
Merit: 1198



View Profile
July 31, 2015, 04:04:54 PM
 #50

You still did not answer my question that you delete from Reddit, after all the text you post.  Huh

The question was where you can download the new wallet.

You can download the new wallet from https://github.com/monero-project/bitmonero

BTW, your post was deleted by a Forum moderator, not anyone related to Monero. You are obviously doing something wrong here. I suggest you clean up your act before you get banned.

Quote
was deleted by a Bitcoin Forum moderator
kazuki49
Sr. Member
****
Offline Offline

Activity: 350
Merit: 250



View Profile
July 31, 2015, 04:24:07 PM
 #51

Lol BCN trolling Monero again at full force, I'll never own a single Bytecoin and I'll make sure every exchange and possible but unlikely bussiness that think of accepting this scam are aware of 82% premine controled by a single entity. All I have to do is point at the proofs: https://bitcointalk.org/index.php?topic=740112.0
smooth
Legendary
*
Offline Offline

Activity: 2968
Merit: 1198



View Profile
July 31, 2015, 04:33:21 PM
 #52

which no one from Monero will answer:

What you missed in your rage over being kept in line by forum mods is that I answered your question

The question was where you can download the new wallet.

You can download the new wallet from https://github.com/monero-project/bitmonero
fluffypony
Donator
Legendary
*
Offline Offline

Activity: 1274
Merit: 1060


GetMonero.org / MyMonero.com


View Profile WWW
July 31, 2015, 04:33:33 PM
 #53

Did you stop copy paste your straw?

Thank you for providing us with a companion quote to go along with such gems as "Is it true?".

DID YOU STOP COPY PASTE YOUR STRAW? DID YOU?!

Please comment the post.

I am littering it with comments as we speak.

Please compare development of monero with the development of the fathers of the code that your coin uses, ups, sorry, this project was stolen from T_F_T.

steal, verb

1. to take (the property of another or others) without permission or right, especially secretly or by force:

2. to appropriate (ideas, credit, words, etc.) without right or acknowledgment.

This cannot apply to Monero. The license covering the code pre-fork was the MIT license:

https://github.com/bitmonero-project/bitmonero/blob/master/src/cryptonote_config.h#L2

Per the text of the MIT license:

"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software"

So we had permission and right. As for acknowledgement, we have included, and continue to include, a CryptoNote copyright notice on all files that originated from before the fork:

https://github.com/monero-project/bitmonero/blob/master/src/cryptonote_config.h#L29

Yes, thats when you scammers started. You Trolleros Devs couldn't even create a genesis block, so you stole the project from T_F_T.

We forked the repo, and retained the social contract implicit in Monero's launch by not relaunching it, thus ensuring that even thankful_for_today was rewarded for his work (ie. as an early miner). If we had relaunched it then it would have been difficult to do so fairly, someone on either side would feel mistreated.

Look what another dev think of your work, 6 months ago, and Monero did not change a thing since then.

Looking at it objectively is always better than quoting the opinion of "another dev", especially when that dev is likely involved in the Bytecoin scam.





You are not just insulting me, you are insulting many others, and your claim is provably untrue. Don't make a statement countering this, provide tangible evidence of your claim.

As for me - monero is a biggest bubble, because there is only speculation about it

Of course there's speculation. But there is also actual use.

blockchain is unusable with its size

How do you suppose you'll have a usable cryptocurrency that is actually used, and yet not have an ever-growing blockchain? What a silly comment, it really shows the desperation of this trolling.

IMO almost everything about monero seems terrible - unusable blockchain size (On average PC, it just can`t be a network node)

Runs just fine on a Raspberry Pi 1 with 256mb RAM, so I guess he must be talking about running it on a 486 DX2 66.

block intervals

Chosen by...thankful_for_today! And here I thought you were hailing him as an incredible human being?

tx generation size

Is duck dark digital dontcareNote really trying to claim that their transactions are significantly smaller?

fee size

0.001 XMR per kilobyte (most transactions are 1kb-2kb), so that's about $0.0000056 per transaction. Gosh. So expensive.

no GUI after almost 1 year since start

Wrong. There are several GUIs: https://getmonero.org/getting-started/choose

totally wrong way of development

As opposed to dNote, which has the "totally right" way of development, no? If that's the case, then why have they attracted NO other contributors?

https://github.com/xdn-project/digitalnote/graphs/contributors vs. https://github.com/monero-project/bitmonero/graphs/contributors

looks like just no understanding of CN technology.

Looks like I've got to rehash some of our research bulletins. Let's do this one:

MRL-0003: Monero is Not That Mysterious

1 Introduction

Recently, there have been some vague fears about the CryptoNote source code and protocol floating around the internet based on the fact that it is a more complicated protocol than, for instance, Bitcoin. The purpose of this note is to try and clear up some misconceptions, and hopefully remove some of the mystery surrounding Monero Ring Signatures. I will start by comparing the mathematics involved in CryptoNote ring signatures (as described in [CN]) to the mathematics in [FS], on which CryptoNote is based. After this, I will compare the mathematics of the ring signature to what is actually in the CryptoNote codebase.

2 CryptoNote Origins

As noted in ([CN], 4.1) by Saberhagen, group ring signatures have a history starting as early as 1991 [CH], and various ring signature schemes have been studied by a number of researchers throughout the past two decades. As claimed in ([CN] 4.1), the main ring signature used in CryptoNote is based on [FS], with some changes to accomodate blockchain technology.

2.1 Traceable Ring Signatures

In [FS], Fujisaki and Suzuki introduce a scheme for a ring signature designed to “leak secrets anonymously, without the risk of identity escrow.” This lack of a need for identity escrow allows users of the ring signature to hide themselves in a group with an inherently higher level of distrust compared to schemes relying on a group manager.

In ring-signature schemes relying on a group manager, such as the original ring signatures described in [CH], a designated trusted person guards the secrets of the group participants. While anonymous, such schemes rely, of course, on the manager not being compromised. The result of having a group-manager, in terms of currencies, is essentially the same as having a trusted organization or node to mix your coins.

In contrast, the traceable ring signature scheme given in [FS] has no group manager. According to [FS], there are four formal security requirements to their traceable ring signature scheme:

•    Public Traceability -Anyone who creates two signatures for di.erent mes.sages with respect to the same tag can be traced. (In CryptoNote, if the user opts not to use a one-time key for each transaction, then they will be traceable, however if they desire anonymity, then they will use the one-time key. Thus as stated on page 5 of [CN], the traceability property is weakened in CryptoNote.)
•    Tag-Linkability -Every two signatures generated by the same signer with respect to the same tag are linked. (This aspect in CryptoNote refers to each transaction having a key image which prevents double spending.)
•    Anonymity -As long as a signer does not sign on two di.erent messages with respect to the same tag, the identity of the signer is indistinguishable from any of the possible ring members. In addition, any two signatures gen.erated with respect to two distinct tags are always unlinkable. (In terms of CryptoNote, if the signer attempts to use the same key-image more than once, then they can be identified out of the group. The unlinkability aspect is retained and is a key part of CryptoNote.)
•    Exculpability -An honest ring member cannot be accused of signing twice with respect to the same tag. In other words, it should be infeasible to counterfeit a tag corresponding to another person’s secret key. (In terms of CryptoNote, this says that key images cannot be faked.)

In addition, [FS] provide a ring signature protocol on page 10 of their paper, which is equivalent to the CryptoNote ring signature algorithm, as described on page 9-10 of [CN]. It is worthwhile to note that [FS] is a publicly peer-reviewed publication appearing in Lecture Notes in Computer Science, as opposed to typical crypto.currency protocol descriptions, where it is unclear whether or not they have been reviewed or not.

2.2 Traceability vs CryptoNote

In the original traceable ring signature algorithm described in [FS], it is possible to use the tag corresponding to a signature multiple times. However, multiple uses of the tag allow the user to be traced; in other words, the signer’s index can be determined out of the group of users signing. It is worthwhile to note that, due to the exculpability feature of the protocol ([FS] 5.6, [CN], A2), keys cannot be stolen this way, unless an attacker is able to solve the Elliptic Curve Discrete Logarithm Problem (ECDLP) upon which a large portion of modern cryptography is based ([Si] XI.4).

The process to trace a tag used more than once is described on ([FS], page 10). In the CryptoNote protocol, however, key images (tags) used more than once are rejected by the blockchain as double-spends, and hence traceability is not an aspect of CryptoNote.

2.3 Tag-Linkability vs CryptoNote

In essence, the tag-linkability aspect of the traceable ring signature protocol is what prevents CryptoNote transactions from being double-spends. The relevant protocols are referred to as “Trace” in ([FS], 5) and “LNK” in the CryptoNote paper. Essentially all that is required is to be able to keep track of the key images which have been used before, and to verify that a key image is not used again.

If one key-image is detected on the blockchain before another key-image, then the second key image is detected as a double-spend transaction. As key-images cannot be forged, being exculpable, the double-spender must in fact be the same person, and not another person trying to steal a wallet.

3 One-Time Ring Signatures (mathematics)

The security of the ring signature scheme as described in ([FS] 10, [CN] 10) and implemented in the CryptoNote source relies on the known security properties of Curve25519. Note that this is the same curve used in OpenSSH 6.5, Tor, Apple iOS, and many other[1] security systems.

3.1 Twisted Edwards Curves

The basic security in the CryptoNote Ring Signature algorithm is guaranteed by the ECDLP ([Si], XI.4) on the Twisted Edwards curve ed25519. The security properties of curve ed25519 are described in [Bern], by noted cryptographer Daniel Bernstein, andin([BCPM])byateamfromMicrosoftResearch.Bernsteinnotesabouted25519 the “every known attack is more expensive than performing a brute-force search on a typical 128-bit secret-key cipher.”

The curve ed25519 is a singular curve of genus 1 with a group law, and described
  
2 .121665 22
by .x+ y2 =1+xy. This curve is considered over the finite field Fq,
121666q =2255 . 19. For those readers unfamiliar with algebraic geometry, an algebraic curve is considered as a one dimensional sort of space, consisting of all points (x, y) satisfying the above equation. All points are also considered modulo q. By virtue of its genus, ed25519 has a “group structure” which, for the purpose of this discussion, means if P =(x1,y1) is a point on the curve, and Q =(x2,y2) is another point on the curve, then these points can be added (or subtracted) and the sum (or di.erence), P + Q (or P . Q) will also be on the curve. The addition is not the naive adding of x1 + x2 and y1 + y2, but instead points are added using the rule

x1y2 + y1x2 y1y2 + x1x2
P + Q = ,
1+ dx1x2y1y2 1 . dx1x2y1y2
  
.121665

[1]http://ianix.com/pub/curve25519-deployment.html

where d =([BBJLP] 6, [BCPM]). The mathematics of curves of genus one are explained in great detail in [Si] for the interested reader.

Based on the above, we can compute P +P for any such point. In order to shorten notation, we rely on our algebraic intuition and denote 2P = P + P . If n . Z, then nP denotes the repeated sum

P + P + ··· + P
P+_ P
n times

using the above nonlinear addition law. As an example of how this di.ers from ordinary addition, consider the following system of equations:

aP + bQ = X
aP ' + bQ' = Y

where a, b, c, d are integers and P, Q, X are points. If this were a standard system of linear equations then one could use linear algebraic techniques to easily solve for a and b, assuming that P, Q, X, Y, P ', and Q ' are known. However, even if a, b are very small the above system is extremely di.cult to solve using the ed25519 addition law. For example, if a =1 and b =1, we have

xP yQ + yP xQ yP yQ + xP xQ
, =(xX ,yX )
1+ dxP xQyP yQ 1 . dxP xQyP yQ
xP 1 yQ1 + yP 1 xQ1 yP 1 yQ1 + xP 1 xQ1
, =(xY ,yY )
1+ dxP 1 xQ1 yP1 yQ1 1 . dxP 1 xQ1 yP 1 yQ1

So in reality, this is a system of 4 nonlinear equations. To convince yourself that it is in fact di.cult to figure out a and b, try writing the above systems assuming a =2, b =1. It should become clear that the problem is extremely di.cult when a, b are chosen to be very large. As of yet, there are no known methods available to e.ciently solve this system for large values of a and b.

Consider the following problem. Suppose your friend has a random integer q, and computes qP using the above form of addition. Your friend then tells you the x and y coordinates qP =(x, y), but not what q itself is. Without asking, how do you find out what q is? A naive approach might be to start with P and keep adding P + P + P... until you reach qP (which you will know because you will end up at (x, y)). But if q is very large then this naive approach might take billions of years using modern supercomputers. Based on what mathematicians currently know about the problem and the number of possible q, none of the currently known attacking techniques can, as a general rule, do better in any practical sense than brute force.

In CryptoNote, your secret key is essentially just a very, very large number x (for other considerations, see section 4.3.3, we choose x to be a multiple of Cool. There is a special point G on the curve ed25519 called “the base point” of the curve which is used as the starting point to get xG. Your public key is just xG, and you are protected by the above problem from someone using known information to determine the private key.

3.2 Relation to Diffie Helman

Included in a ring signature are the following equations involving your secret key x:

P = xG
I = xHp (P )

rs = qs . csx.

Here s is a number giving the index in the group signature to your public key, and Hp (P ) is a hash function which deterministically takes the point P to another point

''
P = x ' G, where x is another very large uniformly chosen number. The value qs is chosen uniformly at random, and cs is computed using another equation involving random values. The particular hash function used in CryptoNote is Keccak1600, used in other applications such as SHA-3; it is currently considered to be secure ([FIPS]). The CryptoNote use of a single hash function is consistent with the standard procedure of consolidating distinct random oracles (in proofs of security in [FS], for example) into a single strong hash function.

The above equations can be written as follows:

P = xG
' ' G '
P = xx
rs = qs . csx


Solving the top two equations is equivalent to the ECDH (as outlined in a previ.ous note ([SN])) and is the same practical di.culty as the ECDLP. Although the equations appear linear, they are in fact highly non-linear, as they use the addition described in 3.1 and above. The third equation (with unknowns qs and x), has the di.culty of finding a random number (either qs or x) in Fq, a very large finite field; this is not feasible. Note that as the third equation has two unknowns, combining it with the previous two equations does not help; an attacker needs to determine at least one of the random numbers qs or x.

3.3 Time Cost to Guess q or x

Since q and x are assumed to be random very large numbers in Fq , with q = 2255 . 19 (generated as 32-byte integers), this is equivalent to a 128-bit security level ([BCPM]), which is known to take billions of years to compute with current supercomputers.

3.4 Review of Proofs in Appendix

In the CryptoNote appendix, there are four proofs of the four basic properties required for security of the one-time ring-signature scheme:

• Linkability (protection against double-spending)
• Exculpability (protection of your secret key)
• Unforgeability (protection against forged ring signatures)
• Anonymity (ability to hide a transaction within other transactions) These theorems are essentially identical to those in [FS] and show that the ring signature protocol satisfies the above traits. The first theorem shows that only the secret keys corresponding to the public keys included in a group can produce a signature for that group. This relies on the ECDLP for the solution of two simulta.neous (non-linear) elliptic curve equations, which, as explained in 3.2, is practically unsolvable. The second theorem uses the same reasoning, but shows that in order to create a fake signature that passes verification, one would need to be able to solve the ECDLP. The third and fourth theorems are taken directly from [FS].

4 One-Time Ring Signatures (Application)

To understand how CryptoNote is implementing the One-Time Ring signatures, I built a model in Python of Crypto-ops.cpp and Crypto.cpp from the Monero source code using naive Twisted Edwards Curve operations (taken from code by Bernstein), rather than the apparently reasonably optimized operations existing in the CryptoNote code. Functions are explained in the code comments below. Using themodelwillproduceaworkingringsignaturethatdi.ersslightlyfromtheMonero ring signatures only because of hashing and packing di.erences between the used libraries. The full code is hosted at the following address: https://github.com/monero-project/mininero

Note that most of the important helper functions in crypto-ops.cpp in the CryptoNote source are pulled from the reference implementation of Curve25519. This reference implentation was coded by Matthew Dempsky (Mochi Media, now Google)[2].

In addition, after comparing the python code to the paper, and in turn comparing the python code to the actual Monero source, it is fairly easy to see that functions like generate_ring_sig are all doing what they are supposed to based on the pro.tocol describedinthewhitepaper. For example,here is the ring signature generation algorithm used in the CryptoNote source:

Algorithm 1 Ring Signatures

i . 0
while i < numkeys do

if i = s then
k . random Fq element
Li . k · G
Ri . k ·Hp(Pi)

else
k1 . random Fq element
k2 . random Fq element
Li . k1Pi + k2G
Ri . k1I + k2Hp(Pi)
ci . k1
ri . k2

end if
i . i +1
end while
h .Hs(prefix + L.is + R.is))
p
cs . h . i ci
=s
rs . k . xcs
return (I, {ci}, {ri})


Comparing this with [CN] shows that it agrees with the whitepaper. Similarly, here is the algorithm used in the CryptoNote source to verify ring signatures:

Algorithm 2 VER
i =0
while i < numkeys do L.. ciPi + riG
i R.. riHp(Pi)+ ciI
i
i . i +1
end while
h .Hs(prefix + L.is + R.is))
p
h . h .
i
=s ci return (h == 0(mod q)) == 0

4.1 Important Crypto-ops Functions

Descriptions of important functions in Crypto-ops.cpp. Even more references and information is given in the comments in the MiniNero.py code linked above.

[2]http://nacl.cr.yp.to/

4.1.1 ge_frombytes_vartime

Takes as input some data and converts to a point on ed25519. For a reference of (q.5)/837 the equation used, . = uvuv, see ([BBJLP], section 5).

4.1.2 ge_fromfe_frombytesvartime

Similar to the above, but compressed in another form.

4.1.3 ge_double_scalarmult_base_vartime

Takes as inputs two integers a and b and a point A on ed25519 and returns the point aA + bG, where G is the ed25519 base point. Used for the ring signatures when computing, for example, Li with i = s as in ([CN], 4.4)

4.1.4 ge_double_scalarmult_vartime

Takes as inputs two integers a and b and two points A and B on ed25519 and outputs aA + bB. Used, for example, when computing the Ri in the ring signatures with i = s ([CN], 4.4)

4.1.5 ge_scalarmult

Given a point A on ed25519 and an integer a, this computes the point aA. Used for example when computing Li and Ri when i = s.

4.1.6 ge_scalarmult_base

Takes as input an integer a and computes aG, where G is the ed25519 base point.

4.1.7 ge_p1p1_to_p2

There are different representations of curve points for ed25519, this converts between them. See MiniNero for more reference.

4.1.8 ge_p2_dbl

This takes a point in the “p2” representation and doubles it.

4.1.9 ge_p3_to_p2

Takes a point in the “p3” representation on ed25519 and turns it into a point in the “p2” representation.

4.1.10 ge_mul8

This takes a point A on ed25519 and returns 8A.

4.1.11 sc_reduce

Takes a 64-byte integer and outputs the lowest 32 bytes modulo the prime q. This is not a CryptoNote-specific function, but comes from the standard ed25519 library.

4.1.12 sc_reduce32

Takes a 32-byte integer and outputs the integer modulo q. Same code as above, except skipping the 64.32 byte step.

4.1.13 sc_mulsub

Takes three integers a, b, c in Fq and returns c . ab modulo q.

4.2 Important Hashing Functions

4.2.1 cn_fast_hash

Takes data and returns the Keccak1600 hash of the data.

4.3 Crypto.cpp Functions

4.3.1 random_scalar

Generates a 64-byte integer and then reduces it to a 32 byte integer modulo q for 128-bit security as described in section 3.3.

4.3.2 hash_to_scalar

Inputs data (for example, a point P on ed25519) and outputs Hs (P ), which is the Keccak1600 hash of the data. The function then converts the hashed data to a 32-byte integer modulo q.

4.3.3 generate_keys

Returns a secret key and public key pair, using random_scalar (asdescribed above) to get the secret key. Note that, as described in [Bern], the key set for ed25519 actually is only multiples of 8 in Fq, and hence ge_scalarmult_base includes a ge_mul8 to ensure the secret key is in the key set. This prevents transaction malleability at.tacks as described in ([Bern], c.f. section on “small subgroup attacks”). This is part of the GEN algorithm as described in ([CN], 4.4).

4.3.4 check_key

Inputs a public key and outputs if the point is on the curve.

4.3.5 secret_key_to_public_key

Inputs a secret key, checks it for some uniformity conditions, and outputs the cor.responding public key, which is essentially just 8 times the base point times the point.

4.3.6 hash_to_ec

Inputs a key, hashes it, and then does the equivalent in bitwise operations of mul.tiplying the resulting integer by the base point and then by 8.

4.3.7 generate_key_image

Takes as input a secret key x and public key P , and returns I = xHp (P ), the key image. This is part of the GEN algorithm as described in ([CN], 4.4).

4.3.8 generate_ring_signature

Computes a ring signature, performing SIG as in ([CN], 4.4) given a key image I, a list of n public keys Pi, and a secret index. Essentially there is a loop on i, and if the secret-index is reached, then an if-statement controls the special computation of Li,Ri when i is equal to the secret index. The values ci and ri for the signature are computed throughout the loop and returned along with the image to create the total signature (I,c1, ..., cn,r1, ..., rn) .

4.3.9 check_ring_signature

Runs the VER algorithm in ([CN], 4.4). The verifier uses a given ring signature n
to compute L ' i = riGi, Ri ' = riHp (Pi)+ ciI, and finally to check ifi=0 ci = Hs (m, L 0' , ..., L ' ,R 0' , ..., R ' ) mod l.nn

4.3.10 generate_key_derivation

Takes a secretkey b,andapublic key P , and outputs 8·bP . (The 8 being for thepur.pose of the secret key set, as described in 4.3.3). This is used in derive_public_key as part of creating one-time addresses.

4.3.11 derivation_to_scalar

Performs Hs (.) as part of generating keys in ([CN], 4.3, 4.4). It hashes an output index together with the point.

4.3.12 derive_public_key

Takes a derivation rA (computed via generate_key_derivation), a point B, and an output index, computes a scalar via derivation_to_scalar, and then computes Hs (rA)+ B.

4.3.13 generate_signature

This takes a prefix, a public key, and a secret key, and generates a standard (not ring) transaction signature (similar to a Bitcoin transaction signature).

4.3.14 check_signature

This checks if a standard (not ring) signature is a valid signature.

5 Conclusion

Despite the ring signature functions in the original CryptoNote source being poorly commented, the code can be traced back to established and used sources, and is rel.atively straightfoward. The Python implementation provided with this review gives further indication of the code’s correctness. Furthermore, the elliptic curve mathe.matics underlying the ring signature scheme has been extremely well-studied; the concept of ring signatures is not novel, even if their application to cryptocurrencies is.

References

BBJLP. Bernstein, Daniel J., et al. "Twisted edwards curves." Progress in Cryptology–AFRICACRYPT 2008. Springer Berlin Heidelberg, 2008. 389-405. BCPM. Bos, Joppe W., et al. "Selecting Elliptic Curves for Cryptography: An E.ciency and Security Analysis." IACR Cryptology ePrint Archive 2014 (2014): 130. Bern. Bernstein, Daniel J. "Curve25519: new Di.e-Hellman speed records." Public Key Cryptography-PKC 2006. Springer Berlin Heidelberg, 2006. 207-228. CH. Chaum, David, and Eugene Van Heyst. "Group signatures." Advances in Cryptology—EUROCRYPT’91. Springer Berlin Heidelberg, 1991. CN. van Saberhagen, Nicolas. "CryptoNote v 2.0." (2013). FIPS. SHA, NIST DRAFT. "standard: Permutation-based hash and extendable-output functions." DRAFT FIPS 202 (2014).
Fu.    Fujisaki, Eiichiro. "Sub-linear size traceable ring signatures without random oracles." IEICE TRANSACTIONS on Fundamentals of Electronics, Communications and Computer Sciences 95.1 (2012): 151-166.
FS.    Fujisaki, Eiichiro, and Koutarou Suzuki. "Traceable ring signature." Public Key Cryptography–PKC 2007. Springer Berlin Heidelberg, 2007. 181-200.
IAN. IANIX http://ianix.com/pub/curve25519-deployment.html Si. Silverman, Joseph H. The arithmetic of elliptic curves. Vol. 106. Dordrecht: Springer, 2009.
SN. http://lab.monero.cc/pubs/multiple_equations_attack.pdf

fluffypony
Donator
Legendary
*
Offline Offline

Activity: 1274
Merit: 1060


GetMonero.org / MyMonero.com


View Profile WWW
July 31, 2015, 06:20:19 PM
 #54

Some unrelease github commits and pdf

DID YOU STOP COPY PASTE YOUR STRAW?

americanpegasus
Hero Member
*****
Offline Offline

Activity: 770
Merit: 500



View Profile
July 31, 2015, 06:35:53 PM
 #55

Oh God.... this reminds me of when I was a kid and staying at my friend's house for the weekend. 
 
He warned me not to make his dad mad.... he said his dad gave out the worse punishments... and I was a little afraid and so tried to mind myself. 
 
Well, that afternoon we were playing in the woods behind the house.  We were only supposed to go a little ways into the woods, only far enough that the adults could still see us if they wanted to. 
 
But we obviously went way, way deeper.  We saw a treehouse a hundred yards in, went to investigate, got turned around, and were gone for hours.  When we came back, the dad had a frown on his face and his belt in his hand. 
 
He divided us up. 
 
He sat me down and proceeded to ask me if I understood the importance of being accountable and responsible, and talked to me trying to get me to understand how it must have made him feel to have lost us in the woods. 
 
He talked, and talked, and talked.  This went on for an hour and a half.  I nearly lost my ten-year-old mind.  I began to wish he would just hit me with the belt, my god, ANYTHING BUT MORE FUCKING TALKING ABOUT WHAT I DID WRONG.  After a literal eternity sitting there talking to me, when I was finally able to tell him exactly why he was mad at us, and convince him I understood he told me I could go. 
 
Then he called his son in, and started the whole process over. 
 
I never wanted to make that man mad again.

Account is back under control of the real AmericanPegasus.
dukey8 (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
July 31, 2015, 07:17:26 PM
 #56

All of my posts are being deleted, even on my own unmoderated thread.

The reply to FluffyPony was deleted from here:

Quote from: Bitcoin Forum
A reply of yours, quoted below, was deleted by a Bitcoin Forum moderator. Posts are most frequently deleted because they are off-topic, though they can also be deleted for other reasons. In the future, please avoid posting things that need to be deleted.

Quote
Some unrelease github commits and pdf

DID YOU STOP COPY PASTE YOUR STRAW?

I can't believe, you flood this thread with garbage because you can't moderate it like the other thread.  Then, you post nonsense, honestly it's like a child.

I can keep posting my unanswered discussion until you answer, you can keep flood this thread with garbage text and nonsense, because you avoid my discussion each time, it is showing more that it is true if you can't.

Users can make up their own mind.


I have contacted the BCT mods, I am guessing Monero is doing this with the reporting system.  More information is here: https://bitcointalk.org/index.php?topic=1139813.msg12019807#msg12019807
smooth
Legendary
*
Offline Offline

Activity: 2968
Merit: 1198



View Profile
July 31, 2015, 07:21:24 PM
 #57

All of my posts are being deleted, even on my own unmoderated thread.

How many times did you repost the same thing, and how many got deleted, even on your own unmoderated thread?

dukey8 (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
August 01, 2015, 01:25:15 AM
Last edit: August 01, 2015, 01:46:32 AM by dukey8
 #58

This is a call to the user who quoted my post that showed the lies of Monero development.

Both are post have been deleted (this is my thread but it still deleted), but everything else was left.

If it's you, please check your private message to see if you have the text because I want to repost it on my thread: https://bitcointalk.org/index.php?topic=1140169.0

My private messages that contain the text of the post warning it was deleted, have also been deleted, so i don't have it.

Thanks

EDIT: I found the post and will contact the user, the information has been deleted though:

Man you hit them hard, trolleros devs are scamming people, but like every scammer they don't admit.

][mod note: deleted coin ad spam]
Pages: « 1 2 [3]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!