HELP - SPONSORED TX on Mainnet Node

Hi there,

I am coming from Inal Kardanov hint to this forum. We like to introduce sponsored transactions for our token.
The first problem encountered is to import the issuer wallet from Waves Online Client to the Waves Node 0.13.4 (MAINNET). The Waves Node Config (waves.config) expects for the wallet{ a SEED and a PASSWORD}. For the SEED I used the seed provided by the Waves Online Client (System Settings -> Wallet -> PRIVATE). The PASSWORD is what I used to login to the Waves Online Client.
After deleting the old wallet.dat file on the Node server, Waves restarts with no problems. But it seems that the wallet on the node has a different public key than, the original wallet from Waves Online Client (also no assets, etc.).

What am I doing wrong? Thank you very much for your help.

Cheers !

it seems you need to reenter your seed phrase and check for space and spelling,

Hi Redfish. I already triple checked this. What could go wrong is that I used vim as editor to change the seed (maybe the config file has special requirements on formatting). I think that the required BASE58 string of the SEED does not comply with the one I copy from Waves Online Client. Might that be? Thank you very much!

you can type manually the 15 word seed phrase and it should be fine. i am doing it all over and its fine.

Wallet seed can be found at [WALLET> SETTING> SECURITY> BACK UP PHRASE]

I never used the private keys in restoring wallet coz it might change the sensitive keys

delete the wallet.dat and make sure your seed is entered inside the config.
It sounds like u had a random generated seed

Thanks ! I think we are getting closer.
If I am using the Mnemonic Seed, like Redfish suggested, I am getting following error:

Exception in thread “main” java.lang.AssertionError: assertion failed: Wrong char in Base58 string
I took the SEED from Waves Online Client -> Settings -> Security -> Backup phrase (i.e. potatoe, etc.)
The Seed is separated by blank spaces between the words. Correct?

Or do I have to convert the words to BASE58 somehow?

EDIT: I tried to convert the SEED (potatoe, etc.) to BASE58 by this bs58-script (https://github.com/cryptocoinjs/bs58). the resulted bs58-string I copied to the waves.config. the node starts. But when I try to set sponsored tx via swagger POST /assets/sponsor it gives the following error:

{
  "error": 112,
  "message": "State check failed. Reason: ActivationError(SponsorFeeTransaction transaction has not been activated yet)",
  "tx": {
    "type": 14,
    "id": "2SwgAtk5m97hcizib5wufwS8qDAYaPiweNg1SkcDN9cw",
    "sender": "3PHrS6VNPRtUD8MHkfkmELavL8JnGtSq5sx",
    "senderPublicKey": "5v5D5pqzKGBejtvtEeyDJXG28iQwMViu1uuetEcyQp9v",
    "fee": 100000000,
    "timestamp": 1533654166308,
    "proofs": [
      "2nAFA91xFomao9Xc1hhreDzbrgmaWVEXXAig1XGXtRKGmRK4jm2eR5vPjG4DcgHktQShNWas7ecVHNo39T4s1AWj"
    ],
    "version": 1,
    "assetId": "FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN",
    "minSponsoredAssetFee": 100000
  }
}

I entered the following in the input of POST /assets/sponsor:

{
    "version": 1,
    "sender": "3PHrS6VNPRtUD8MHkfkmELavL8JnGtSq5sx",
    "assetId": "FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN",
    "minSponsoredAssetFee": 100000,
    "fee": 100000000
}

according to this source: https://docs.wavesplatform.com/en/technical-details/sponsored-fee.html

Do you use TestNet or MainNet? What’s your current node height?

You can also use your own wallet, not the one that included into node.

Hi,
I am using MaiNet on { “height”: 1077072.

I am trying to use my own wallet - but i dont get it into the node.
I did not know that I can use a different wallet than the one who created the asset (asset issues != asset sponsor?). I thought the error above proofs that exactly this is not possible.

There should be really an easy introduction how to get your waves-wallet from waves-online to your waves-node.

Update: I delete all blocks and resyncht the chain from scratch.
Now I could execute the Sponsor Fee POST by:

{
“version”: 1,
“sender”: “3PHrS6VNPRtUD8MHkfkmELavL8JnGtSq5sx”,
“assetId”: “FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN”,
“minSponsoredAssetFee”: 100000,
“fee”: 100000000
}


Now it seems something worked out by getting this RESPONSE BODY:

{
“type”: 14,
“id”: “DELfH1zUzZpozrD983xNZUpXAU869oZmDvmjBex4nRES”,
“sender”: “3PHrS6VNPRtUD8MHkfkmELavL8JnGtSq5sx”,
“senderPublicKey”: “5v5D5pqzKGBejtvtEeyDJXG28iQwMViu1uuetEcyQp9v”,
“fee”: 100000000,
“timestamp”: 1533835640591,
“proofs”: [
“2r47anzHhjoFEhLfRRBS6YBJJUSYVVwsRWpq1iSfNxhkNGSfDXMjxFhF6QPxryABeGFQjXqXw882qhUgKiMCYugM”
],
“version”: 1,
“assetId”: “FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN”,
“minSponsoredAssetFee”: 100000
}


How do I check if it works now? Do I have to wait for 1000blocks / 8 hours?

Thank you all! Spacibo

Hello!

To test the sponsorship, just try to send a transfer with fee in the asset. There is no need to wait 1000 blocks, if the sponsorship is working and the fee is enough the transaction should pass.

Hi Alexey,

thank your very much for your reply. I tried to send from my mobile(iOS) waves app some custom-tokens without having Waves in my wallet. It displays the error, that I do not have enough funds to do the transaction.

In the app I chose:
Amount: 1
Currency: zeb.coin
Fee: 0,001 Waves (Standard Fee)

What am I doing wrong in the app? Thank you very much !

For now it’s impossible to create a transaction paid in an asset using official wallets (nor old one, nor new, nor mobile wallets). Sad, but true. The only possible way is to use node’s API to broadcast a transaction. But it requires some programming skills.
This possibility will be added to official wallets (at least online one).
Usually paying fees in assets used by node owners, they use some scripts to perform the task.

Hi Alexey, thanks for the fast reply. I assumed that I would be like that. Can you say at what time this will be implemented at least for the waves online app?

Despite this I tried to use the Node API to transfer a payment, but it still gives me error code 112 (see below). Thank you for a hint what the problem could be.

Thanks!

{
“error”: 112,
“message”: “State check failed. Reason: Attempt to transfer unavailable funds: Transaction application leads to negative asset ‘WAVES’ balance to (at least) temporary negative state, current balance is 0, spends equals -1, result is -1”,
“tx”: {
“type”: 4,
“id”: “EjU47C2gKcWqkbi6Kv1mBmSFb2kZgmL352n2ehkfTRcT”,
“sender”: “3PHrS6VNPRtUD8MHkfkmELavL8JnGtSq5sx”,
“senderPublicKey”: “5v5D5pqzKGBejtvtEeyDJXG28iQwMViu1uuetEcyQp9v”,
“fee”: 1,
“timestamp”: 1534263533806,
“signature”: “Kcj6VnxuHWtDmkM2Tt4j8gubFFryF4ZJt621oyH18NsryR4h5Css56hFtUY46LMi7dS2njufabRPd5tE7jCeWpF”,
“version”: 1,
“recipient”: “3PBBe5FNBsfNLQvtVoA1uTuRn6EoYgxANCJ”,
“assetId”: “FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN”,
“feeAssetId”: “WAVES”,
“feeAsset”: “WAVES”,
“amount”: 1,
“attachment”: “test”
}
}

The wallet devs told me that they plan to implement the feature this autumn.

I think that you have to provide your assets’ ID FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN as a feeAssetId value too in your request. Error message and reply shows that you have provided nothing to feeAssetId that leads to default fee in Waves.

Hi Alexey,

thank you so much for helping out. With you trick I now get a differnet error code:
“error”: 112,
“message”: “State check failed. Reason: Asset FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN is not sponsored, cannot be used to pay fees”,

Let me recap what I did wrong. In order to create my asset being sponsored I executed:
https://pastebin.com/mB6YjwLN

I got an “okay”-looking JSON message that the asset is now sponsored by following output:
https://pastebin.com/gD0KR7Cv

When I try to initiate the POST/assets/transfer I with the following adapted command:
https://pastebin.com/mA3i3WZe

I get the error message from above, here in the full output:
https://pastebin.com/TWVuAji0

I am very grateful if we could get this going somehow. Thank you very much !

Hi!

As I can see, where is no sponsorship transaction on the blockchain for your asset.
To check it try to lookup for the transaction ID (9MxxBSWNGhbJktMKc2u4FYZu2yzkGtryVQgfVmKjcL5P):

https://nodes.wavesnodes.com/transactions/info/9MxxBSWNGhbJktMKc2u4FYZu2yzkGtryVQgfVmKjcL5P

Or check the details of the asset:

https://nodes.wavesnodes.com/assets/details/FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN
{
  "assetId": "FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN",
  "issueHeight": 832276,
  "issueTimestamp": 1515695599102,
  "issuer": "3PHrS6VNPRtUD8MHkfkmELavL8JnGtSq5sx",
  "name": "zebcoin",
  "description": "zeb.coin",
  "decimals": 1,
  "reissuable": true,
  "quantity": 1000000,
  "script": null,
  "scriptText": null,
  "complexity": 0,
  "extraFee": 0,
  "minSponsoredAssetFee": null
}

Last line says it’s not sponsored.

Also, from the details I can see that your asset has 1 decimal. So, if you want for example to set minimal fee to 2.5 zebcoins you have to set minimal fee to 25. Because it calculated in “cents”. But you’ve tried to set it to 100000, that means 10’000.0 zebcoins min fee :slight_smile:

Try to set sponsorship again. It should work.

Hi Alexey,

understood that was stupid from my side. I now changed the POST command according to your exmaple:

{
“version”: 1,
“sender”: “3PHrS6VNPRtUD8MHkfkmELavL8JnGtSq5sx”,
“assetId”: “FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN”,
“minSponsoredAssetFee”: 25,
“fee”: 100000000
}

This results into a okay-looking response:

{
“type”: 14,
“id”: “5rEuG5bgRuZrfENevJXhZazQ4haA9SJYHhgmvqFddKJ6”,
“sender”: “3PHrS6VNPRtUD8MHkfkmELavL8JnGtSq5sx”,
“senderPublicKey”: “5v5D5pqzKGBejtvtEeyDJXG28iQwMViu1uuetEcyQp9v”,
“fee”: 100000000,
“timestamp”: 1534363775550,
“proofs”: [
“4thRNRt8XFvc2Y7mkPKHq4MpgLSMhDoV9jafq4rUqKxCwSqmF5qdj68axCmdyKd7HSeiN5Rube9pTHAv4BEEQduZ”
],
“version”: 1,
“assetId”: “FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN”,
“minSponsoredAssetFee”: 25
}

Unfortunately still the asset displays for minSponsoredAssetFee=null:

What am I doing wrong? I have Waves 1 and zeb.coin 30 on my wallet imported to the node.
Thank you for getting this to work very much!

Haven’t you forgot to broadcast the transaction?
As I understand, you used /transactions/sign API method to get the signed transaction.
And you have to broadcast it to the network. Use /transactions/broadcast method to do it.
I’ve failed to broadcast your transaction because it’s timestamp is too old.
You have to sing it again and broadcast it in 90 minutes.

Hi Alexey,

yes that was the trick. I did it and it works now - as well is now displayed under the asset information as sponsored flag with 10 zeb.coins.

Now I tried to transfer the assset with POST /assets/transfer and get another strange error on decimals:

{
“error”: 112,
“message”: “State check failed. Reason: Fee in FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN for scorex.transaction.transfer.TransferTransactionV1 does not exceed minimal value of 100000 WAVES: 10000”,
“tx”: {
“type”: 4,
“id”: “DtYe8RVEJQNuW8okPUoUSH7KRciB8qBfD63uZwoa5G8E”,
“sender”: “3PHrS6VNPRtUD8MHkfkmELavL8JnGtSq5sx”,
“senderPublicKey”: “5v5D5pqzKGBejtvtEeyDJXG28iQwMViu1uuetEcyQp9v”,
“fee”: 1,
“timestamp”: 1534702323889,
“signature”: “3sH1VczbKMutEidGDvqLgDsq3tSJcXeaQGREZ9MVpt3k3NsqHhBhzbbQJfCPTNWkCy4eiB9MiAk8D8vzJRrzWZDS”,
“version”: 1,
“recipient”: “3PBBe5FNBsfNLQvtVoA1uTuRn6EoYgxANCJ”,
“assetId”: “FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN”,
“feeAssetId”: “FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN”,
“feeAsset”: “FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN”,
“amount”: 1,
“attachment”: “test”
}
}

If I understand the error message correctly it asks me for 10.000 Waves on my bucket to do this? That would be really new to my latest informations.

Thanks for an info and best regards,

You have set the minimal fee to 10 zebcoins cents.

{
  "type": 14,
  "id": "7EL2XEGP1By427BeLcHPYeVnBzGsXen4egMAwQpWGBVR",
  "sender": "3PHrS6VNPRtUD8MHkfkmELavL8JnGtSq5sx",
  "senderPublicKey": "5v5D5pqzKGBejtvtEeyDJXG28iQwMViu1uuetEcyQp9v",
  "fee": 100000000,
  "timestamp": 1534448057070,
  "proofs": [
    "3Q4JS4ujrGxAqp8LMXR9zZJC4tJ7YHiTo4SvMgrPhufo2UtR5x9JAaCGDjEr7qWXFDPJk7vWL8eapQkS45Dx1kcb"
  ],
  "version": 1,
  "assetId": "FN76goSi7hQn6gQ8aezKVwyDvhkWx5ekXbP3sNLWqavN",
  "minSponsoredAssetFee": 10, <--- this is 10 zebcoins cents equals to 100'000 wavelets
  "height": 1130205
}

But in your transfer you want to pay only 1 zebcoin cent as fee.

...
“fee”: 1,
...

This equals to 10’000 wavelets. The error is about this.
You have to pay not less then 10 zebcoin cents as fee. In this case the miner will receive 100000 wavelets from your wallet. If somebody pays 20 zebcoin cents as fee, the miner will receive 200000 wavelets for processing this transaction.