Giter Club home page Giter Club logo

mobilecoin's Introduction

Testing your first payment

  • Please see TESTNET.md for instructions on participating in the TestNet!

Sending your first payment

Note to Developers

  • Please see CONTRIBUTING.md for notes on contributing bug reports and code.

MobileCoin

MobileCoin is a privacy-preserving payments network designed for use on mobile devices.

Table of Contents

License

MobileCoin is available under open-source licenses. Look for the LICENSE file in each crate for more information.

Cryptography Notice

This distribution includes cryptographic software. Your country may have restrictions on the use of encryption software. Please check your country's laws before downloading or using this software.

Repository Structure

Directory Description
attest Remote attestation primitives.
build-info Measurements made at compile time.
common Items shared across MobileCoin crates.
consensus Byzantine Fault Tolerant Consensus.
crypto Cryptography.
enclave-boundary Intel® SGX ECALL infrastructure.
fog Private payments for mobile devices
ledger Storage and synchronization for the MobileCoin blockchain.
mcbuild Tools for building and signing enclaves.
mcconnection Attested MobileCoin connections.
mobilecoind Blockchain daemon and example client code.
peers Peer-to-peer networking.
sgx Support for Intel® Software Guard eXtensions (Intel SGX).
transaction Private transactions.
util Miscellaneous utilities.

Selected Binaries

Target Description Used by...
consensus-service Validates new transactions for the public ledger. Validator Nodes
ledger-distribution Publishes the ledger to long-term storage. Full Validator Nodes
mobilecoind Synchronizes the ledger and provides the desktop API. Watcher and Validator Nodes

Build Instructions

The workspace can be built with cargo build and tested with cargo test. Either command will recognize the cargo --release flag to build with optimizations.

Some crates (for example consensus-service) depend on Intel SGX, which adds additional build and runtime requirements. For detailed information about setting up a build environment, how enclaves are built, and on configuring the build, see BUILD.md.

For a quick start, you can build in the same docker image that we use for CI, using the mob tool. Note that this requires you to install Docker. You can use the mob tool with the following commands:

# From the root of the cloned repository
./mob prompt

# At the resulting docker container prompt
cargo build

Overview

MobileCoin is a payment network with no central authority. The fundamental goal of the network is to safely and efficiently enable the exchange of value, represented as fractional ownership of the total value of the network. Like most cryptocurrencies, MobileCoin maintains a permanent and immutable record of all successfully completed payments in a blockchain data structure. Cryptography is used extensively to establish ownership, control transfers, and to preserve cash-like privacy for users.

Here we review a few design concepts that are essential for understanding the software.

Transactions

The MobileCoin blockchain is the source of truth for the allocation of value. It consists of an ordered collection of transaction outputs, organized into blocks. Each transaction output ("txo") has a unique corresponding construction called a key image. Every txo initially appears in the blockchain in a spendable state, as an unspent transaction output or utxo. Every successful payment consumes some utxos as inputs and creates new utxos as outputs. When a utxo is consumed, its corresponding key image is permanently added to the blockchain, ensuring that it can not be spent a second time.

The total value of the MobileCoin network is fixed by convention at a sum of 250 million mobilecoins. Each mobilecoin consists of 1012 indivisible parts, each referred to as one picomob. Each utxo represents an integer number of picomob that can be consumed in a valid payment.

Ownership of a utxo in the MobileCoin network is equivalent to knowledge of two private keys, called the spend private key and the view private key, that provision control over discovery and transfer of value. Most users will derive these two private key values from a single underlying key we call the root entropy.

To receive a payment, a user must calculate the two public key values corresponding to their private keys to share with their counter-party. MobileCoin specifies a standard encoding scheme using a base-58 symbol library for users to safely exchange payment information.

For more information on how transactions work, and how they use CrytpoNote-style transactions to preserve privacy of both the sender and receiver, see the transaction crate.

To understand the blockchain format and storage, see the ledger_db crate.

Consensus

New transactions must be checked for attempts to counterfeit value before new key images and utxos can be added to the MobileCoin blockchain. Transactions are prepared by the user on their local computer or mobile device, and submitted to a secure enclave running on a validator node of their choice. The validator node checks the transaction and, assuming it believes the transaction is valid, shares it with other nodes in the MobileCoin network. The transaction is passed only to peer secure enclaves that can establish via remote attestation that they are running unmodified MobileCoin software on an authentic Intel processor. Each secure enclave replicates a state machine that adds valid transactions to the ledger in a deterministic order using a consensus algorithm called the MobileCoin Consensus Protocol.

The MobileCoin Consensus Protocol is a high-performance solution to the byzantine agreement problem that allows new payments to be rapidly confirmed. The consensus-service target binary uses Intel Software Guard eXtensions (Intel SGX) to provide defense-in-depth improvements to privacy and trust.

To learn how MobileCoin uses Intel SGX to provide additional integrity in Byzantine Fault Tolerant (BFT) consensus as well as forward secrecy to secure your privacy, see the consensus/enclave crate. To build and run consensus, see the consensus/service crate.

Full validator nodes additionally use the ledger-distribution target binary to publish a copy of their computed blockchain to content delivery networks (currently to Amazon S3 only). The public blockchain is a zero-knowledge data structure that consists only of utxos, key images and block metadata used to ensure consistency and to construct Merkle proofs. To build and run ledger distribution, see the ledger/distribution crate.

Watcher nodes perform an essential role in the MobileCoin network by verifying the signatures that the full validator nodes attach to each block. In this way the watcher nodes continuously monitor the integrity of the decentralized MobileCoin network. A watcher node also maintains a complete local copy of the blockchain and provides an API for wallet or exchange clients.

To run a watcher node, build and run the mobilecoind daemon.

FAQ

  1. What is the impact of an Intel SGX compromise on transaction privacy?

    Secure enclaves can provide improved integrity and confidentiality while functioning as intended. Like most complex new technologies, we should anticipate that design flaws will inevitably be discovered. Several side channel attacks against secrets protected by Intel SGX have been published, and subsequently patched or otherwise mitigated. MobileCoin is designed to provide "defense in depth" in the event of an attack based on a secure enclave exploit. MobileCoin transactions use CryptoNote technology to ensure that, even in the clear, the recipient is concealed with a one-time address, the sender is concealed in a ring signature, and the amounts are concealed with Ring Confidential Transactions (RingCT).

    In the event of an Intel SGX compromise, the attacker's view of the ledger inside the enclave would still be protected by both ring signatures and one-time addresses, and amounts would remain concealed with RingCT. These privacy protection mechanisms leave open the possibility of statistical attacks that rely on tracing the inputs in ring signatures to determine probabilistic relationships between transactions. This attack is only applicable to transactions made during the time that the secure enclave exploit is known, but not patched. Once the Intel SGX vulnerability is discovered and addressed, statistical attacks are no longer possible, therefore forward secrecy is preserved.

  2. Can I run a validator node without Intel SGX?

    You can run the consensus-service using Intel SGX in simulation mode, however you will not be able to participate in consensus with other validator nodes. Your software measurement will be different from hardware-enabled Intel SGX peers and remote attestation will fail.

  3. Can I run a watcher node without Intel SGX?

    Yes, you can operate a watcher node and validate block signatures by running the mobilecoind daemon, which does not require Intel SGX.

  4. I thought you were called MobileCoin. Where is the code for mobile devices?

    Please see fog, android-bindings, and libmobilecoin, to see how the balance checking and transaction building process works on mobile devices that don't sync the ledger.

    Please see also the MobileCoin Android and iOS SDKs, which can be integrated into your app to enable MobileCoin payments.

  5. Will I need to put my keys on a remote server to scan the blockchain for incoming transactions?

    Keys will never leave your mobile device. For more details on how this works, please see the MobileCoin Fog README.

Support

For troubleshooting help and other questions, please visit our community forum.

You can also open a technical support ticket via email.

Trademarks

Intel and the Intel logo are trademarks of Intel Corporation or its subsidiaries. MobileCoin is a registered trademark of MobileCoin Inc.

mobilecoin's People

Contributors

aweis89 avatar awygle avatar briancorbin avatar brson avatar carybakker avatar cbeck88 avatar christian-oudard avatar dependabot[bot] avatar dolanbernard avatar eranrund avatar holtzman avatar iamalwaysuncomfortable avatar integral-llc avatar jcape avatar jgreat avatar joekottke avatar kylefleming avatar mfaulk avatar nick-mobilecoin avatar pouneh avatar remoun avatar rjwalters avatar ryankurte avatar samdealy avatar sugargoat avatar the-real-adammork avatar tsegaran avatar varsha888 avatar wjuan-mob avatar xoloki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobilecoin's Issues

Notify users on older clients of newer client verisions.

I was using the mobile-coin-purse 0.1.2 when it stopped syncing yesterday making it unusable. With the launch of mobile-coin-purse.0.1.3 the client is now syncing again.

If there is a need to update the client, you should have your old client notify the user (in big bold text at the top of the client) that there is a newer client to use and they should update the client.

-Ruben

ConsensusEnclave::enclave_init panicks on unparsable sealed key

If I pass a bogus file to mc-consensus-service --sealed-block-signing-key the enclave will panick when calling IntelSealed::try_from in ConsensusEnclave::enclave_init.

This is harmless, but not the right error handling mode for this error - the enclave probably shouldn't be panicking on bad input. Instead of unwrapping errors in ConsensusEnclave::enclave_init they should probably be propagated with ?.

2 build errors due to "feature may not be used on the stable release channel"

Running the cargo build command, gives me the following errors:

Compiling subtle v2.2.2
Compiling ansi_term v0.11.0
Compiling vec_map v0.8.1
Compiling futures-core v0.3.4
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.2.2/src/lib.rs:12:34
   |
12 | #![cfg_attr(feature = "nightly", feature(asm))]
   |                                  ^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.2.2/src/lib.rs:13:34
   |
13 | #![cfg_attr(feature = "nightly", feature(external_doc))]
   |                                  ^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0554`.
error: could not compile `subtle`.
warning: build failed, waiting for other jobs to finish...
error: build failed

More info about the error via rustc:

Feature attributes are only allowed on the nightly release channel. Stable or
beta compilers will not comply.

Example of erroneous code (on a stable compiler):

#![feature(non_ascii_idents)] // error: #![feature] may not be used on the
                              //        stable release channel

If you need the feature, make sure to use a nightly release of the compiler
(but be warned that the feature may be removed or altered in the future).

Anyone else having issues with the subtle build?

(Ubuntu 18.04.4 LTS)

Edit:
Verbose

Compiling subtle v2.2.2
     Running `rustc --crate-name subtle /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.2.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="nightly"' -C metadata=d6b3040c568b31ca -C extra-filename=-d6b3040c568b31ca -C rpath --out-dir /home/xx/mobilecoin/target/debug/deps -L dependency=/home/xx/mobilecoin/target/debug/deps --cap-lints allow -D warnings -C target-cpu=skylake`
error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.2.2/src/lib.rs:12:34
   |
12 | #![cfg_attr(feature = "nightly", feature(asm))]
   |                                  ^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.2.2/src/lib.rs:13:34
   |
13 | #![cfg_attr(feature = "nightly", feature(external_doc))]
   |                                  ^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0554`.
error: could not compile `subtle`.

Caused by:
  process didn't exit successfully: `rustc --crate-name subtle /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/subtle-2.2.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="nightly"' -C metadata=d6b3040c568b31ca -C extra-filename=-d6b3040c568b31ca -C rpath --out-dir /home/xx/mobilecoin/target/debug/deps -L dependency=/home/xx/mobilecoin/target/debug/deps --cap-lints allow -D warnings -C target-cpu=skylake` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed

mobilecoind does not compile for Windows

One of the cardinal rules for MobileCoin is that users should never have to share their private keys with a remote server. This implies that all of the participants in the test network need to be able to run a local instance of mobilecoind to sync the ledger and build transactions.

Attempting to build mobilecoind for Windows (without Docker) looks like this:

PS C:\Users\Robb\Desktop\GitHub\mobilecoin\mobilecoind> cargo +nightly-2019-12-19 build --release
   Compiling mbedtls v0.5.1 (https://github.com/mobilecoinofficial/rust-mbedtls.git?tag=mc-0.2#20e6fbb6)
error: failed to run custom build command for `mbedtls v0.5.1 (https://github.com/mobilecoinofficial/rust-mbedtls.git?tag=mc-0.2#20e6fbb6)`

Caused by:
  process didn't exit successfully: `C:\Users\Robb\Desktop\GitHub\mobilecoin\target\release\build\mbedtls-06d16eacb65d7eef\build-script-build` (exit code: 1)
--- stdout
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = None
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("adx,aes,avx,avx2,bmi1,bmi2,cmpxchg16b,f16c,fma,fxsr,lzcnt,mmx,movbe,pclmulqdq,popcnt,rdrand,rdseed,sse,sse2,sse3,sse4.1,sse4.2,ssse3,xsave,xsavec,xsaveopt,xsaves")
DEBUG = Some("false")
running: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-W4" "-FoC:\\Users\\Robb\\Desktop\\GitHub\\mobilecoin\\target\\release\\build\\mbedtls-10cea2e2cc320eb5\\out\\src/rust_printf.o" "-c" "src/rust_printf.c"
rust_printf.c
src/rust_printf.c(25): error C2057: expected constant expression
src/rust_printf.c(25): error C2466: cannot allocate an array of constant size 0
src/rust_printf.c(25): error C2133: 'p': unknown size
exit code: 2

MobileCoin depends on a fork of a Fortanix project in which we have updated bindgen (see fortanix/rust-mbedtls#5).

However we have not yet fixed some other issues there related to Windows support (see fortanix/rust-mbedtls#84).

Patching rust-mbedtls to work on Windows seems like the next step towards inviting Windows users to try out MobileCoin!

Request 'https://ipinfo.io/' timeout

Hi everyone, your work is amazing!
Uh, it seems that Mobilecoind will access "ipinfo.io", but "ipinfo.io" is blocked somewhere.

thread 'main' panicked at 'Could not validate host: Reqwest(reqwest::Error { kind: Request, url: "https://ipinfo.io/111.197.233.95/json/", source: TimedOut })', mobilecoind/src/bin/main.rs:22:32

image

Windows Subsystem Linux (WSL) Ubuntu Error

Getting the following socket error when trying to run the Linux testnet client:

asp@Surface-Laptop:~/mobilecoin-testnet-linux$ ./mobilecoin-testnet.sh
Daemon is starting up
E0423 14:31:50.556821900     402 socket_utils_common_posix.cc:313] setsockopt(TCP_USER_TIMEOUT) Protocol not available
E0423 14:31:52.560275900     406 socket_utils_common_posix.cc:313] setsockopt(TCP_USER_TIMEOUT) Protocol not available
Unable to connect to mobilecoind on 127.0.0.1:4444.
Are you sure it is running and accepting connections?

The error was: RpcFailure: 14-UNAVAILABLE failed to connect to all addresses
Terminated

Environment Details:

asp@Surface-Laptop:~/mobilecoin-testnet-linux$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:        18.04
Codename:       bionic

can not sync blocks from peers

I’m trying to use the RPC of mobilecoind. I have built the mobilecoind follow the steps on Github. I used the following command to start the mobilecoind, however, it can not sync the blocks.

./mobilecoind  --ledger-db /tmp/ledger-db \
--poll-interval 10 \
--peer mc://node1.test.mobilecoin.com/ \
--peer mc://node2.test.mobilecoin.com/ \
--tx-source-url https://s3-us-west-1.amazonaws.com/mobilecoin.chain/node1.test.mobilecoin.com/ \
--tx-source-url https://s3-us-west-1.amazonaws.com/mobilecoin.chain/node2.test.mobilecoin.com/ \
--mobilecoind-db /tmp/transaction-db \
--service-port 4444 &> $(pwd)/mobilecoind.log &

Here is the log:

2020-05-08 07:50:40.105421300 UTC ERRO Failed getting last block from mc://node2.test.mobilecoin.com:443/: Operation { error: Attestation(Grpc(RpcFailure(RpcStatus { status: 1-CANCELLED, details: Some("Received http2 header with status: 404") }))), total_delay: 7.15s, tries: 11 }, mc.app: mobilecoind, mc.module: mc_ledger_sync::polling_network_state, mc.src: ledger/sync/src/polling_network_state.rs:95
2020-05-08 07:50:40.106238300 UTC ERRO Failed getting last block from mc://node1.test.mobilecoin.com:443/: Operation { error: Attestation(Grpc(RpcFailure(RpcStatus { status: 1-CANCELLED, details: Some("Received http2 header with status: 404") }))), total_delay: 7.15s, tries: 11 }, mc.app: mobilecoind, mc.module: mc_ledger_sync::polling_network_state, mc.src: ledger/sync/src/polling_network_state.rs:95

The precompiled dmg package works well in my Mac.

Setuid purse for no reason.

As I have brought up on numerous occasions on the secret electron slack, shipping Linux binaries setuid is just bad practice. modern linuxes support fine-grained namespaces so we don't need to have the application (chrome) start as root. The problem is that if a bad library is slipped in the LD_LIRBARY_PATH you could potentially load some dynamic code that hacks the machine as root. In addition, as the purse isn't open-source, I'm not a super fan of installing setuid binaries as I can't audit them.

In the meantime, I'd suggest

  1. DIsabling the setuid bit as a part of the deb package creation immediately. I've already tested it on my machine and it doesn't need chrome to be setuid for the purse to run
  2. Providing an alternative legacy package if people don't want to enable namespaces. It's easy enough to just create two debs
  3. Provide instructions for archlinux users and others on how to enable namespaces, it's already needed for tools like docker and is pretty standard.

Documenting extended testnet usage

Deconstructing mobilecoin-testnet.sh I figured out

  • Where my logs are 👍
  • and that it's starting a service on port 4444. Perhaps we should put that on the front page with some running the release instructions?
  • Where the lmdb files we use for storage
#!/bin/bash
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
export RUST_LOG=INFO

./bin/mobilecoind --ledger-db /tmp/mobilecoin/0.4.0/ledger \
      --poll-interval 1 \
      --peer mc://node1.test.mobilecoin.com/ \
      --peer mc://node2.test.mobilecoin.com/ \
      --tx-source-url https://s3-us-west-1.amazonaws.com/mobilecoin.chain/node1.test.mobilecoin.com/ \
      --mobilecoind-db /tmp/mobilecoin/0.4.0/wallet \
      --listen-uri insecure-mobilecoind://127.0.0.1:4444/ > /tmp/mobilecoind.log 2>&1 &
echo Daemon is starting up
sleep 10

./bin/mc-testnet-client

Since we are using /tmp we should expect people to constantly have it whiped out and restored.

Do we wanna document any of this? If so where?

Build failed on Macos

Run SGX_MODE=HW IAS_MODE=DEV cargo build and get flowing

error on line 49 of /project/github.com/mobilecoinfoundation/mobilecoin/crypto/x509/test-vectors/openssl.cnf
4493999788:error:0EFFF068:configuration file routines:CRYPTO_internal:variable has no value:/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-56.60.2/libressl-2.8/crypto/conf/conf_def.c:563:line 49

Cash pickup

Can my delivery person notify me so I won't talk to anyone unnecessary

Unable to build mobilecoind on Mac

  $ SGX_MODE=SW IAS_MODE=DEV cargo build
   ...
   error: failed to run custom build command for `mc-crypto-x509-test-vectors v1.0.0 (/Users/username/third-party-code/mobilecoin/crypto/x509/test-vectors)`
   Caused by:
     process didn't exit successfully: `/Users/username/third-party-code/mobilecoin/target/debug/build/mc-crypto-x509-test-vectors-4550859e053fd91d/build-script-build` (exit code: 10
   1)
   --- stdout
   cargo:rerun-if-changed=/Users/username/third-party-code/mobilecoin/crypto/x509/test-vectors/openssl.cnf
   ...
   error on line 49 of /Users/username/third-party-code/mobilecoin/crypto/x509/test-vectors/openssl.cnf
   4706643628:error:0EFFF068:configuration file routines:CRYPTO_internal:variable has no value:/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-56.60.2/libressl-2.8/crypto/conf/conf_def.c:563:line 49
   thread 'main' panicked at 'Generate script did not succeed', crypto/x509/test-vectors/build.rs:23:9

Tidy up the python

Our python code could use some love. Here are my plans

  • Add a linter to the container . I really love black cause it's fast and opinionated
  • Push out new docker images with the linter in it.
  • Remove some of the extra unneeded stuff from the container
  • Upgrade the scripts to use the new docker image.
  • Actually use the linter in the ci
  • Consider adding something like mypy or other logic checkers
  • A once through to look for bad smells or needed tests

Questions regarding this project

Hi I have some questions regarding this project:

  1. Is it workable right now? Am I able to generate hashes to earn money?
  2. Can I control how much processing power to take to generate hashes?
  3. Am I able to change the output or not even display a console session for situations I may not want a console to open and for it to run in the background?
  4. Say if I have the crypto wallet stored on my computer A and it is off, and I am doing cryptomining (using this crate) on Computer B and Computer B does NOT store the wallet and I wanted to send it off. Do I need to store the wallet on a server? Does the crypto wallet have a server where I can chose to create a wallet and where all my money can go over there?
  5. Is this library capable of sending generated hashes via the Internet?
  6. Am I able to use The Rust Programming Language to script and control mining? If so how difficult would it be to code it up?
  7. If 6 is applicable, then how efficiently can I generate the code?
  8. Is it as private and secure as Monera?
  9. Does it support Windows and Linux?

Mobilecoin build fails with illegal instruction

I'm trying to follow the instructions in https://github.com/mobilecoinfoundation/mobilecoin/blob/ae596fb127f89814bbf20b3849cddc5714e4eb96/consensus/service/BUILD.md on a fresh Ubuntu 18.04 install on an Intel NUC model 7CJYH4 with a Celeron J4005 cpu. Both master and the v1.1.0-pre1 tag have the same failure.

Within the container I get the following:

# SGX_MODE=HW IAS_MODE=DEV cargo build -p mc-consensus-service
  Downloaded thiserror-impl v1.0.20
  Downloaded thiserror v1.0.20
  Downloaded anyhow v1.0.28
  Downloaded unicode-normalization v0.1.12
  Downloaded zeroize v1.1.0
  Downloaded displaydoc v0.1.7
  Downloaded protobuf-codegen v2.20.0
  Downloaded curve25519-dalek v3.0.0
  Downloaded protobuf v2.20.0
  Downloaded 9 crates (869.8 KB) in 1.05s
   Compiling anyhow v1.0.28
   Compiling mc-util-build-info v1.1.0-pre1 (/tmp/mobilenode/util/build/info)
   Compiling protobuf v2.20.0
   Compiling mc-sgx-types v1.1.0-pre1 (/tmp/mobilenode/sgx/types)
   Compiling mc-util-host-cert v1.1.0-pre1 (/tmp/mobilenode/util/host-cert)
   Compiling proc-macro2 v1.0.24
error: failed to run custom build command for `proc-macro2 v1.0.24`

Caused by:
  process didn't exit successfully: `/tmp/mobilenode/target/debug/build/proc-macro2-d9a323b814519ba7/build-script-build` (signal: 4, SIGILL: illegal instruction)
--- stdout
cargo:rerun-if-changed=build.rs

warning: build failed, waiting for other jobs to finish...
error: build failed

dmesg on the host displays:

[ 3013.789628] traps: build-script-bu[9457] trap invalid opcode ip:55d017d2dd2c sp:7fffaf38e8d0 error:0 in build-script-build[55d017d26000+54000]

Version info:

# cargo --version
cargo 1.46.0-nightly (c26576f9a 2020-06-23)
root@5dafdfa3feb4:/tmp/mobilenode# rustc --version
rustc 1.46.0-nightly (16957bd4d 2020-06-30)

can't build src/sha256_aarch64.S on aarch64-apple-darwin (M1 mac)

Once I updated the rust-toolchain to use nightly from 2020-12-01, I ultimately got an error.

My git diff says:
diff --git a/docker/rust-toolchain b/docker/rust-toolchain
index a5fd288..3e8a548 100644
--- a/docker/rust-toolchain
+++ b/docker/rust-toolchain
@@ -1 +1 @@
-nightly-2020-07-01
+nightly-2020-12-01

and i built with:
$ cargo build

and my (truncated) build output is:

Compiling idna v0.2.0
Compiling idna v0.1.5
The following warnings were emitted during compilation:

warning: src/sha256_aarch64.S:64:2: error: ADR/ADRP relocations must be GOT relative
warning: adrp x2, .K
warning: ^
warning: src/sha256_aarch64.S:64:2: error: unknown AArch64 fixup kind!
warning: adrp x2, .K
warning: ^
warning: src/sha256_aarch64.S:65:2: error: unknown AArch64 fixup kind!
warning: add x2, x2, :lo12:.K
warning: ^

error: failed to run custom build command for sha2-asm v0.5.3

Caused by:
process didn't exit successfully: /Users/ryan/crypto/mobilecoin/target/debug/build/sha2-asm-04a825482d678500/build-script-build (exit code: 1)
--- stdout
TARGET = Some("aarch64-apple-darwin")
OPT_LEVEL = Some("0")
HOST = Some("aarch64-apple-darwin")
CC_aarch64-apple-darwin = None
CC_aarch64_apple_darwin = None
HOST_CC = None
CC = None
CFLAGS_aarch64-apple-darwin = None
CFLAGS_aarch64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("crc,crypto,fp,fp16,lse,neon,ras,rcpc,rdm,v8.1a,v8.2a,v8.3a")
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-Wall" "-Wextra" "-march=armv8-a+crypto" "-c" "-o" "/Users/ryan/crypto/mobilecoin/target/debug/build/sha2-asm-af9e21b1cc577a61/out/src/sha256_aarch64.o" "-c" "src/sha256_aarch64.S"
cargo:warning=src/sha256_aarch64.S:64:2: error: ADR/ADRP relocations must be GOT relative
cargo:warning= adrp x2, .K
cargo:warning= ^
cargo:warning=src/sha256_aarch64.S:64:2: error: unknown AArch64 fixup kind!
cargo:warning= adrp x2, .K
cargo:warning= ^
cargo:warning=src/sha256_aarch64.S:65:2: error: unknown AArch64 fixup kind!
cargo:warning= add x2, x2, :lo12:.K
cargo:warning= ^
exit code: 1

--- stderr

error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-Wall" "-Wextra" "-march=armv8-a+crypto" "-c" "-o" "/Users/ryan/crypto/mobilecoin/target/debug/build/sha2-asm-af9e21b1cc577a61/out/src/sha256_aarch64.o" "-c" "src/sha256_aarch64.S" with args "cc" did not execute successfully (status code exit code: 1).

warning: build failed, waiting for other jobs to finish...
error: build failed

Running mobilecoind in Watcher mode fails to get block from peers

NB: Cross-posting from the community forum as the post hasn't gotten any attention there yet.

I am trying to run mobilcoind in watcher mode using the following command:

./target/release/mobilecoind     --ledger-db ledger/     --mobilecoind-db mobilecoind-db --watcher-db watcher-db  
  --poll-interval 10     --peer mc://node1.prod.mobilecoinww.com/     --peer mc://node2.prod.mobilecoinww.com/    
 --tx-source-url https://ledger.mobilecoinww.com/node1.prod.mobilecoinww.com/    
 --tx-source-url https://ledger.mobilecoinww.com/node2.prod.mobilecoinww.com/  
   --listen-uri insecure-mobilecoind://127.0.0.1:4444/

based on the MAINNET README.

I generated the sample ledger which is being passed to --ledger-db.

The binary starts successfully but the according to the output, it seems like mobilecoind is not able to download the blocks from the peers.

Mobilecoind Output on Start

2021-05-21 12:57:07.988016731 UTC INFO mobilecoind started: { "GIT_COMMIT": "7973273-modified", "PROFILE": "release", "DEBUG": "false", "OPT_LEVEL": "3", "DEBUG_ASSERTIONS": "false", "TARGET_ARCH": "x86_64", "TARGET_OS": "linux", "TARGET_FEATURE": "cmpxchg16b,fxsr,sse,sse2,sse3", "RUSTFLAGS": "?", "SGX_MODE": "HW", "IAS_MODE": "PROD" }, mc.app:
 mobilecoind, mc.module: mc_common::logger::loggers, mc.src: common/src/logger/loggers/mod.rs:246                                                                            2021-05-21 12:57:08.006884974 UTC INFO Ledger db is currently at version: MetadataVersion { database_format_version: 20200707, created_by_crate_version: "1.0.1-pre1", _s: Le
dgerDbMetadataStoreSettings }, mc.app: mobilecoind, mc.module: mc_ledger_db, mc.src: ledger/db/src/lib.rs:342
2021-05-21 12:57:08.007950538 UTC INFO Ledger DB "ledger/" opened: num_blocks=1 num_txos=1000, mc.app: mobilecoind, mc.module: mobilecoind, mc.src: mobilecoind/src/bin/main.
rs:164                          
2021-05-21 12:57:08.008740750 UTC INFO Launching watcher., mc.app: mobilecoind, mc.module: mobilecoind, mc.src: mobilecoind/src/bin/main.rs:74
2021-05-21 12:57:08.008807797 UTC INFO Opening watcher db at "watcher-db"., mc.app: mobilecoind, mc.module: mobilecoind, mc.src: mobilecoind/src/bin/main.rs:76
2021-05-21 12:57:08.009994802 UTC INFO Watcher db is currently at version: MetadataVersion { database_format_version: 20210127, created_by_crate_version: "1.0.1-pre1", _s: W
atcherDbMetadataStoreSettings }, mc.app: mobilecoind, mc.module: mc_watcher::watcher_db, mc.src: watcher/src/watcher_db.rs:162
2021-05-21 12:57:08.010786222 UTC INFO Watcher DB "watcher-db" opened, sync status = {Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Som
e(Domain("ledger.mobilecoinww.com")), port: None, path: "/node2.prod.mobilecoinww.com/", query: None, fragment: None }: Some(0), Url { scheme: "https", cannot_be_a_base: fal
se, username: "", password: None, host: Some(Domain("ledger.mobilecoinww.com")), port: None, path: "/node1.prod.mobilecoinww.com/", query: None, fragment: None }: Some(0)}, 
mc.app: mobilecoind, mc.module: mc_watcher::watcher_db, mc.src: watcher/src/watcher_db.rs:1017
2021-05-21 12:57:08.010868068 UTC INFO Starting watcher sync thread from mobilecoind., mc.app: mobilecoind, mc.module: mobilecoind, mc.src: mobilecoind/src/bin/main.rs:88
2021-05-21 12:57:08.034395714 UTC INFO Launching mobilecoind API services, mc.app: mobilecoind, mc.module: mobilecoind, mc.src: mobilecoind/src/bin/main.rs:108
2021-05-21 12:57:08.035174188 UTC INFO Mobilecoind db is currently at version: MetadataVersion { database_format_version: 20200805, created_by_crate_version: "1.0.1-pre1", _
s: MobilecoindDbMetadataStoreSettings }, mc.app: mobilecoind, mc.module: mc_mobilecoind::database, mc.src: mobilecoind/src/database.rs:87
2021-05-21 12:57:08.036543580 UTC INFO Starting mobilecoind sync task thread, mc.app: mobilecoind, mc.module: mc_mobilecoind::service, mc.src: mobilecoind/src/service.rs:78
2021-05-21 12:57:08.040969278 UTC INFO Starting mobilecoind API Service on insecure-mobilecoind://127.0.0.1:4444/, mc.app: mobilecoind, mc.module: mc_mobilecoind::service, m
c.src: mobilecoind/src/service.rs:134
2021-05-21 12:57:08.254419506 UTC WARN Failed to retrieve blocks from mc://node1.prod.mobilecoinww.com:443/: InvalidBlockId, mc.app: mobilecoind, mc.module: mc_ledger_sync::
ledger_sync::ledger_sync_service, mc.src: ledger/sync/src/ledger_sync/ledger_sync_service.rs:399
2021-05-21 12:57:08.255772157 UTC WARN Failed to retrieve blocks from mc://node2.prod.mobilecoinww.com:443/: InvalidBlockId, mc.app: mobilecoind, mc.module: mc_ledger_sync::
ledger_sync::ledger_sync_service, mc.src: ledger/sync/src/ledger_sync/ledger_sync_service.rs:399
2021-05-21 12:57:08.255851270 UTC ERRO Attempt ledger sync failed: No potentially safe blocks., mc.app: mobilecoind, mc.module: mc_ledger_sync::ledger_sync::ledger_sync_serv
ice_thread, mc.src: ledger/sync/src/ledger_sync/ledger_sync_service_thread.rs:138

The ERROR and WARN messages are repetitive.

Is this a problem with the peers?

I then found this list of trusted peers and using some as peers which has gotten rid of the WARN messages, however, the ERR message is still the same.

Mobilecoind Output on start with different peers

...
2021-05-21 13:57:09.296296363 UTC INFO Starting mobilecoind API Service on insecure-mobilecoind://127.0.0.1:4444/, mc.app: mobilecoind, mc.module: mc_mobilecoind::service, mc.src: mobilecoind/src/service.rs:134                                                                                                                                        
2021-05-21 13:57:12.695505924 UTC INFO Archive block retrieved for Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("bd-mobilecoin-ledger.s3.amazonaws.com")), port: None, path: "/thelongnowfoundation.mobilecoin.bdnodes.net/", query: None, fragment: None } 0, mc.app: mobilecoind, mc.module: mc_watcher::watcher, mc.src: watcher/src/watcher.rs:162                                                                                                                              
2021-05-21 13:57:16.705233059 UTC ERRO Failed getting last block from mc://thelongnowfoundation.mobilecoin.bdnodes.net:8443/: Operation { error: Attestation(Grpc(RpcFailure(
RpcStatus { status: 7-PERMISSION_DENIED, details: Some("peer_auth: \"Permission denied\"") }))), total_delay: 7.15s, tries: 11 }, mc.app: mobilecoind, mc.module: mc_ledger_s
ync::network_state::polling_network_state, mc.src: ledger/sync/src/network_state/polling_network_state.rs:100
2021-05-21 13:57:16.768317786 UTC ERRO Failed getting last block from mc://blockdaemon.mobilecoin.bdnodes.net:8443/: Operation { error: Attestation(Grpc(RpcFailure(RpcStatus
 { status: 7-PERMISSION_DENIED, details: Some("peer_auth: \"Permission denied\"") }))), total_delay: 7.15s, tries: 11 }, mc.app: mobilecoind, mc.module: mc_ledger_sync::netw
ork_state::polling_network_state, mc.src: ledger/sync/src/network_state/polling_network_state.rs:100

It seems to be a permission error - if so, how does a new mobilcoin node authenticate itself?

link to download client goes to 404

in test.md the links to the linux and mac downloads go to 404s, I can't find the release folder that it should be switched to or I'd submit this as a pull request.

Enclave Question

If I understand the enclave mechanism correctly, it protects the memory of the node from being accessed by other processes.
Is there anything that prevents an attacker from modifying the code of the node to not use the Enclave without telling other nodes?

Testnet client: Sending coins to own address

It's possible and there is no warning, when sending money to his own address. There's nothing in the source code (as of yet) to warn you, but I'd think that's behaviour that should be discouraged. It also shows a wrong remaining balance for that.

Build fails on Ubuntu 18.04.3 LTS (Elementary OS 5.1) with kind: NotFound, error: "failed to spawn \"protoc\" \"protoc\" \"--version\": No such file or directory (os error 2)"

madde@madde-laptop:~/Documents/Programmierung/rust/mobilecoin$ cargo build
[...]
error: failed to run custom build command for attest-api v0.1.0 (/home/madde/Documents/Programmierung/rust/mobilecoin/attest/api)

Caused by:
process didn't exit successfully: /home/madde/Documents/Programmierung/rust/mobilecoin/target/debug/build/attest-api-58fb4ed0281a428b/build-script-build (exit code: 101)
--- stdout
cargo:rerun-if-changed=./proto
cargo:rerun-if-changed=./proto/attest.proto

--- stderr
thread 'main' panicked at 'Failed to compile gRPC definitions!: Custom { kind: NotFound, error: "failed to spawn \"protoc\" \"protoc\" \"--version\": No such file or directory (os error 2)" }

failed to find protoc, protoc must be availabe in PATH', src/libcore/result.rs:1188:5
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed

Running ./mob prompt

madde@madde-laptop:~/Documents/Programmierung/rust/mobilecoin$ ./mob prompt
Warning: Could not pull from: gcr.io/mobilenode-211420/builder-install:1_9
Warning: Could not pull from: gcr.io/mobilenode-211420/builder-install:1_8
Traceback (most recent call last):
File "./mob", line 272, in
if args.action == "image" or not have_tag(tag):
File "./mob", line 149, in have_tag
return len(subprocess.check_output(cmd)) > 0
File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/usr/lib/python3.6/subprocess.py", line 423, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.6/subprocess.py", line 729, in init
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'docker': 'docker'

System:
Elementary OS 5.1 (Built on Ubuntu 18.04.3 LTS)

The API routers of mobilecoind-mirror

Hi,

I installed and ran the latest release. According to the README of mobilecoind-mirror, I can access /block/{n} and /processed-block/{n}. I tried some other routes, but I can't access them. What other routes does mobilecoind-mirror support? For example, I want to use it to sign and send transactions.

[feature request]save processed blocks into database, and expose an api

Hi, mobilecoin team.

I'm working in a cryptocurrency exchange, we are planning to launch mobilecoin on our site. Your works on protecting user's privacy are awesome.

The major job of our exchange program is to monitor user's deposit. We use get_block API to fetch the block data and filter the transaction data we need, for coins like BTC, LTC, etc.. But mobilecoind's get_block API only returning the encrypted content.

Currently, mobilecoind will process blocks via this function https://github.com/mobilecoinofficial/mobilecoin/blob/30bffcb62aecb422f0d3086e23c5d00e6e816e5b/mobilecoind/src/sync.rs#L314 . Would you like to save the processed data into a database, then expose an API like get_block_with_decrypted_data for fetching the keyimages and utxos related to our user's addresses.

Without this API, we have to decrypt the block data by ourselves, it's a bit inconvenient.

Thank you!

Network fuzzing results

Hey everyone. I decided my first public networking fuzzing project would be mobilecoin. I'm sorry if my questions are super noobish. I'm not a cryptographer, professional crypto person, security person, nor expert at anything. However, I am running on a Chromebook with the built-in Linux VM. I downloaded the most recent release of the client Client Update 2020-11-08. I started up, downloaded the chain, and saw a wallet with 0 coins.
I then downloaded https://github.com/nccgroup/fuzzowski, installed it, and ran

python3 -m fuzzowski -f telnet_cli -p tcp  localhost 4444

After a few minutes, I noticed even after restarting the fuzzer, it was unable to send to that port quickly, almost as if the service is degraded. I restarted the fuzzer to no avail. I noticed restarting mobile coin fixed it, suggesting fuzzing mobilecoin with random activity caused some change in state.

  • I am not sure where the logs are for my ubuntu /journald based system. Y'all should probably provide that as part of launch instructions.

cargo test / cargo build fail on mbedtls-sys-auto v2.18.1 (Ubuntu)

Hi,

I'm on commit b3ef5e6 with a clean repo. After mob prompt I find both cargo build and cargo test fail on mbedtls-sys-auto v2.18.1 (https://github.com/mobilecoinofficial/rust-mbedtls.git?tag=mc-0.2#20e6fbb6).

Output shown below. The error triggering the failure is

CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_CXX_COMPILER
    CMAKE_CXX_FLAGS


vendor/include/mbedtls/bignum.h:140:49: warning: declaration does not declare anything [-Wmissing-declarations], err: false

How can I resolve this?

error: failed to run custom build command for `mbedtls-sys-auto v2.18.1 (https://github.com/mobilecoinofficial/rust-mbedtls.git?tag=mc-0.2#20e6fbb6)`

Caused by:
  process didn't exit successfully: `/tmp/mobilenode/target/debug/build/mbedtls-sys-auto-40eeaf3323369c4e/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=RUST_MBEDTLS_SYS_SOURCE

[.. omitted ..]

running: "cmake" "cmake" "/tmp/mobilenode/cargo/git/checkouts/rust-mbedtls-7d1033e9d0cc8048/20e6fbb/mbedtls-sys/vendor" "-DENABLE_PROGRAMS=OFF" "-DENABLE_TESTING=OFF" "-DCMAKE_INSTALL_PREFIX=/tmp/mobilenode/target/debug/build/mbedtls-sys-auto-ce8c8c66c68d9b4d/out" "-DCMAKE_C_FLAGS= -DMBEDTLS_CONFIG_FILE=\"\\\"/tmp/mobilenode/target/debug/build/mbedtls-sys-auto-ce8c8c66c68d9b4d/out/config.h\\\"\" -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_BUILD_TYPE=Debug"
-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PythonInterp: /usr/bin/python (found version "2.7.17") 
-- Found Perl: /usr/bin/perl (found version "5.26.1") 
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/mobilenode/target/debug/build/mbedtls-sys-auto-ce8c8c66c68d9b4d/out/build
running: "cmake" "cmake" "--build" "." "--target" "lib" "--config" "Debug" "--"
Scanning dependencies of target mbedcrypto
[100%] Linking C static library libmbedtls.a
[100%] Built target mbedtls
Scanning dependencies of target lib
[100%] Built target lib
cargo:root=/tmp/mobilenode/target/debug/build/mbedtls-sys-auto-ce8c8c66c68d9b4d/out
cargo:rustc-link-search=native=/tmp/mobilenode/target/debug/build/mbedtls-sys-auto-ce8c8c66c68d9b4d/out/build/library
running: "cmake" "cmake" "/tmp/mobilenode/cargo/git/checkouts/rust-mbedtls-7d1033e9d0cc8048/20e6fbb/mbedtls-sys/vendor" "-DENABLE_PROGRAMS=OFF" "-DENABLE_TESTING=OFF" "-DCMAKE_INSTALL_PREFIX=/tmp/mobilenode/target/debug/build/mbedtls-sys-auto-ce8c8c66c68d9b4d/out" "-DCMAKE_C_FLAGS= -DMBEDTLS_CONFIG_FILE=\"\\\"/tmp/mobilenode/target/debug/build/mbedtls-sys-auto-ce8c8c66c68d9b4d/out/config.h\\\"\" -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_BUILD_TYPE=Debug"
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/mobilenode/target/debug/build/mbedtls-sys-auto-ce8c8c66c68d9b4d/out/build
running: "cmake" "cmake" "--build" "." "--target" "lib" "--config" "Debug" "--"
[100%] Built target mbedtls
[100%] Built target lib
cargo:root=/tmp/mobilenode/target/debug/build/mbedtls-sys-auto-ce8c8c66c68d9b4d/out
cargo:rustc-link-search=native=/tmp/mobilenode/target/debug/build/mbedtls-sys-auto-ce8c8c66c68d9b4d/out/build/crypto/library
cargo:rustc-link-lib=mbedtls
cargo:rustc-link-lib=mbedx509
cargo:rustc-link-lib=mbedcrypto

--- stderr
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_CXX_COMPILER
    CMAKE_CXX_FLAGS


vendor/include/mbedtls/bignum.h:140:49: warning: declaration does not declare anything [-Wmissing-declarations], err: false
thread 'main' panicked at 'capacity overflow', src/liballoc/raw_vec.rs:777:5
stack backtrace:
   0:     0x55a0ecf3ecf4 - backtrace::backtrace::libunwind::trace::h0a48c85c8012426b
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1:     0x55a0ecf3ecf4 - backtrace::backtrace::trace_unsynchronized::hd59d821c5709c879
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2:     0x55a0ecf3ecf4 - std::sys_common::backtrace::_print_fmt::h1aa050417bb0b607
                               at src/libstd/sys_common/backtrace.rs:84
   3:     0x55a0ecf3ecf4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h068618ade673b259
                               at src/libstd/sys_common/backtrace.rs:61
   4:     0x55a0ecf64bfc - core::fmt::write::h72d2c3a2a8405f91
                               at src/libcore/fmt/mod.rs:1025
   5:     0x55a0ecf3b037 - std::io::Write::write_fmt::h36b1a7b93b325264
                               at src/libstd/io/mod.rs:1426
   6:     0x55a0ecf4185e - std::sys_common::backtrace::_print::h40b9c256f1edfa08
                               at src/libstd/sys_common/backtrace.rs:65
   7:     0x55a0ecf4185e - std::sys_common::backtrace::print::h0f6ce4b3cbaba788
                               at src/libstd/sys_common/backtrace.rs:50
   8:     0x55a0ecf4185e - std::panicking::default_hook::{{closure}}::h2e0a4a0d4aa5cb77
                               at src/libstd/panicking.rs:193
   9:     0x55a0ecf41551 - std::panicking::default_hook::ha8ece3680c7da126
                               at src/libstd/panicking.rs:210
  10:     0x55a0ecf42010 - std::panicking::rust_panic_with_hook::h748222843c9136a2
                               at src/libstd/panicking.rs:475
  11:     0x55a0ecf41aee - rust_begin_unwind
                               at src/libstd/panicking.rs:375
  12:     0x55a0ecf615ce - core::panicking::panic_fmt::h28daaedf5bd7eef6
                               at src/libcore/panicking.rs:84
  13:     0x55a0ecf6151a - core::panicking::panic::h808e87b2d4de672e
                               at src/libcore/panicking.rs:51
  14:     0x55a0ecf5bcaa - alloc::raw_vec::capacity_overflow::h177048cbd6b65c54
                               at src/liballoc/raw_vec.rs:777
  15:     0x55a0eca2075a - alloc::raw_vec::RawVec<T,A>::allocate_in::{{closure}}::h1f024ddffed38acc
                               at /rustc/19bd93467617a447c22ec32cc1cf14d40cb84ccf/src/liballoc/raw_vec.rs:86
  16:     0x55a0ec99129a - core::option::Option<T>::unwrap_or_else::h12700168cffe883c
                               at /rustc/19bd93467617a447c22ec32cc1cf14d40cb84ccf/src/libcore/option.rs:422
  17:     0x55a0eca20232 - alloc::raw_vec::RawVec<T,A>::allocate_in::he94ec6f14f6effba
                               at /rustc/19bd93467617a447c22ec32cc1cf14d40cb84ccf/src/liballoc/raw_vec.rs:86
  18:     0x55a0eca1e8f6 - alloc::raw_vec::RawVec<T>::with_capacity::h9d9a6f8e01d954a4
                               at /rustc/19bd93467617a447c22ec32cc1cf14d40cb84ccf/src/liballoc/raw_vec.rs:167
  19:     0x55a0eca0ca74 - alloc::collections::vec_deque::VecDeque<T>::with_capacity::h82bf8a0195d39c4c
                               at /rustc/19bd93467617a447c22ec32cc1cf14d40cb84ccf/src/liballoc/collections/vec_deque.rs:481
  20:     0x55a0eca0ce03 - alloc::collections::vec_deque::VecDeque<T>::new::h41ecabbd34c43581
                               at /rustc/19bd93467617a447c22ec32cc1cf14d40cb84ccf/src/liballoc/collections/vec_deque.rs:460
  21:     0x55a0ec9bbb13 - <bindgen::ir::enum_ty::Enum as bindgen::codegen::CodeGenerator>::codegen::h65f221873cf84d2d
                               at /tmp/mobilenode/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/codegen/mod.rs:2733
  22:     0x55a0eca4abad - <bindgen::ir::ty::Type as bindgen::codegen::CodeGenerator>::codegen::hc6c509b6e883ff09
                               at /tmp/mobilenode/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/codegen/mod.rs:813
  23:     0x55a0eca48a86 - <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen::h36b15e1b2a12bd84
                               at /tmp/mobilenode/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/codegen/mod.rs:381
  24:     0x55a0ecac4b3c - <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::{{closure}}::h6f0a4285a591820e
                               at /tmp/mobilenode/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/codegen/mod.rs:403
  25:     0x55a0ec966497 - <bindgen::ir::module::Module as bindgen::codegen::CodeGenerator>::codegen::h5b2af8b650b98d2a
                               at /tmp/mobilenode/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/codegen/mod.rs:433
  26:     0x55a0eca489d2 - <bindgen::ir::item::Item as bindgen::codegen::CodeGenerator>::codegen::h36b15e1b2a12bd84
                               at /tmp/mobilenode/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/codegen/mod.rs:372
  27:     0x55a0ecad3c53 - bindgen::codegen::codegen::{{closure}}::h9199f1ac2fc654b7
                               at /tmp/mobilenode/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/codegen/mod.rs:3632
  28:     0x55a0ec978313 - bindgen::ir::context::BindgenContext::gen::h5f0a6988055d593d
                               at /tmp/mobilenode/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/ir/context.rs:1200
  29:     0x55a0ecad323b - bindgen::codegen::codegen::h2b5265794d50976f
                               at /tmp/mobilenode/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/codegen/mod.rs:3606
  30:     0x55a0ec9496dc - bindgen::Bindings::generate::h1fcc9e6d0fd7a027
                               at /tmp/mobilenode/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/lib.rs:1882
  31:     0x55a0ec947477 - bindgen::Builder::generate::hac01f5abdde62d9c
                               at /tmp/mobilenode/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.51.1/src/lib.rs:1244
  32:     0x55a0ec874fa9 - build_script_build::mod_bindgen::<impl build_script_build::BuildConfig>::bindgen::h6311779a245076fc
                               at /tmp/mobilenode/cargo/git/checkouts/rust-mbedtls-7d1033e9d0cc8048/20e6fbb/mbedtls-sys/build/bindgen.rs:92
  33:     0x55a0ec877f8b - build_script_build::main::hd0167bc603ed6a0d
                               at /tmp/mobilenode/cargo/git/checkouts/rust-mbedtls-7d1033e9d0cc8048/20e6fbb/mbedtls-sys/build/build.rs:109
  34:     0x55a0ec885e40 - std::rt::lang_start::{{closure}}::h5fbcaa54acc38185
                               at /rustc/19bd93467617a447c22ec32cc1cf14d40cb84ccf/src/libstd/rt.rs:67
  35:     0x55a0ecf41983 - std::rt::lang_start_internal::{{closure}}::ha966a90a2223d318
                               at src/libstd/rt.rs:52
  36:     0x55a0ecf41983 - std::panicking::try::do_call::h7048802f1f0056de
                               at src/libstd/panicking.rs:292
  37:     0x55a0ecf49bda - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:78
  38:     0x55a0ecf42490 - std::panicking::try::h3d7ba80ee84a3ede
                               at src/libstd/panicking.rs:270
  39:     0x55a0ecf42490 - std::panic::catch_unwind::h2f15a5533e64a496
                               at src/libstd/panic.rs:394
  40:     0x55a0ecf42490 - std::rt::lang_start_internal::h0e133c31a2e415aa
                               at src/libstd/rt.rs:51
  41:     0x55a0ec885e19 - std::rt::lang_start::h472c3670a0d6a390
                               at /rustc/19bd93467617a447c22ec32cc1cf14d40cb84ccf/src/libstd/rt.rs:67
  42:     0x55a0ec87809a - main
  43:     0x7f53c64a8b97 - __libc_start_main
  44:     0x55a0ec86f1da - _start
  45:                0x0 - <unknown>

root@d5223bf05724:/tmp/mobilenode#

In Python API, start_mobilecoind.sh appears to be broken.

$ ./start_mobilecoind.sh
Installing mobilecoind from latest mobilecoind-mirror-tls...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 171 100 171 0 0 356 0 --:--:-- --:--:-- --:--:-- 355
100 9 100 9 0 0 14 0 --:--:-- --:--:-- --:--:-- 14
tar: Error opening archive: Unrecognized archive format
mv: cannot stat './mobilecoind-mirror': No such file or directory
Starting mobilecoind
./start_mobilecoind.sh: line 48: /tmp/mobilecoind-testnet/bin/mobilecoind: No such file or directory

Effect of SGX deprecation?

What impact does the fact that the newest Intel chips (Tiger and Rocket Lake) no longer include SGX have on MobileCoin?

Is there a Simple Tutorial

Hi, exploring mobile coin because I need a coin with a good lawyer. Any tutorials available externally for building with mobile coin?

Coins

How can I receive funds via pickup or cash app

Incorrect Balance Displayed on second machine

MobileCoin client displayed the incorrect balance upon start when run on a second machine. The correct balance was displayed after subsequent check balance requests and client restarts.

Steps to reproduce

  1. Extract & Run Linux client on one machine.

  2. Make a payment

  3. Extract & Run Linux client on a second machine.

  4. Client displayed original balance of 100.000MOB

  5. Check Balance then displayed correct balance of 98.999MOB

When i run `cargo test` under ./api, will error

cd ~/mobilecoin/api

cargo build works ok

cargo test will get the following errors:

Compiling mc-common v1.0.0 (/Users/x/Projects/mobilecoin/common)
Compiling mc-util-test-helper v1.0.0 (/Users/x/Projects/mobilecoin/util/test-helper)
error[E0433]: failed to resolve: use of undeclared type or module std
--> common/src/panic_handler.rs:5:5
|
5 | use std::{
| ^^^ use of undeclared type or module std

error[E0433]: failed to resolve: use of undeclared type or module std
--> common/src/logger/mod.rs:101:13
|
101 | use std::time::Instant;
| ^^^ use of undeclared type or module std

.....

error[E0599]: no method named to_string found for reference &'static str in the current scope
--> common/src/panic_handler.rs:22:65
|
22 | let process_name = env::args().next().unwrap_or_else(|| "?".to_string());
| ^^^^^^^^^ method not found in &'static str
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope; perhaps add a use for it:
use crate::alloc::string::ToString;

error: aborting due to 20 previous errors

Some errors have detailed explanations: E0412, E0432, E0433, E0599.
For more information about an error, try rustc --explain E0412.
error: could not compile mc-common.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.