About issue token

looking forward to a more friendly tutorial. let developers access faster

Yeah, we will have a wallet app that works on pretty much all devices including a web browser.

And yeah, to do it yourself you will have to monitor the chain for transactions related to your keys/addresses and parse the new balances out of tokenized messages.

If I want to send tokens, does need to sign in inputs ?

To send a token the owner always needs to provide signatures in the inputs to give permission for the smart contract to transfer the tokens to a new address.

Depending on the configuration of the contract and asset other signatures may be needed as well. If identity oracles are specified, then the transfer request will need to include a signature from the oracle to approve the receiver of the tokens. This is used to ensure the token holders meet the legal/compliance requirements of the token.

thank Karl.
Now I want to try to issue token and send it . Also I am looking into this https://github.com/tokenized/smart-contract .from this test demo, I am wonder if i need to follow the steps below:
2 step for AssetCreate: Create contract, Send AssetTx to the node
2 step for SendToken: Create contract, Send TransferTx to the node

You need to form a contract first. Assets can only be created once a smart contract has been formed with a C1 (Contract Offer) request action and a C2 (Contract Formation) response action.

Then you can create an asset using the A1 (Asset Definition) request action, which will be responded by the smart contract with an A2 (Asset Creation) action, if valid.

Once the asset is created you will then be able to transfer tokens between addresses.

Make sense?

Do all the actions need to be sent to the bitcoin network? Including request and response.

np and yes, all request and response actions need to be sent to the Bitcoin network.

Another problem is that when I use the mainnet wallet to send the contract, the program will report an error, and the client.config reports a null pointer.

@KarlTheProgrammer will have to help you with this.

Check out this post and then if you are still having trouble, try to give me some more details.

I have been unable to synchronize block heights when I run smartcontract sync. The height I set is 560000, hash: 0000000000000000035cb1baaf4f82d8358a8b9ed22aec52c2801a02b9c6f18f
Have you ever seen this situation?

Did you stop it? It looks like you only let it run for 5 seconds before shutting it down. It takes longer than that to synchronize headers. It depends on how fast your connection is to your full node.

I tried to set up the maxconnections of the full node and then run smartcontractd again. It is also reconnecting.

Looks like there are connection issues to your full node.

Thank you for your patience.
There is a problem. After running smartcontractd, when I call the method to send the Request Action for
Contract, will smartcontractd automatically generate a Response Action and send to broadcast?

smartcontractd is designed to be running all the time. And yes, its job is to respond to requests on chain by broadcasting response transactions. It uses bitcoin sent to it in the request to pay the tx fee for the response tx.

When I send the contractOffer with cli, client_log prints these warn logs, and only the contractOffer is seen in the blockchain, and it does not see it responded with a C2 message.What caused this?

Those fail messages are just from some of the nodes it is trying to send the contract offer to. Those nodes are probably BTC or BCH and return the header for block 1 since they don’t recognize the latest BSV block headers.

At least one node verified it was on the BSV chain, so CLI sent the tx. CLI doesn’t look for the C2 response, so it won’t see it.

Is smartcontractd running? Can you look in your smartcontractd log for the contract offer txid? Also, verify that the first output of your contract offer is to the smartcontractd address.


Yes.Smartcontractd is running locally.


I found that my smartcontractd IS_TEST is set to false, and my CLI’s IS_TEST is set to true, then I changed them to the same. Finally smartcontractd successfully responded with a C2 message

Finally it works.Thank you very much.:smile: