How to Submit an NNS motion Proposal (WIP)

The error is because the candid ui always sends calls as the anonymous caller. To call the manage_neuron method is with the caller/identity that controls the neuron. In Diego’s case he is using the identity he created called ‘proposals’

1 Like

So just to make sure I understand, this error message will always occur when trying to call manage_neuron with Candid UI because I can’t send it (and therefore authorize it) with the identity that I created for this neuron ID. Basically, it sounds like I have come as far as possible with testing short of submitting an actual proposal and losing 1 ICP for the test because of a Rejected proposal. Does that sound about right or are there other ways of testing the manage_neuron command with my neuron and identity without actually making a proposal? I suppose this may be the reason why several people have submitted test proposals in the past. @levi

Sounds right, I dont know of a way to test it without making a live one. maybe on a local replica if you can get the governance canister running on it.

I will be honest, I actually created a live one while testing :slight_smile: since I started creating them a few months ago when the IC was still baking, and it was my job to actually help write the docs.

Of course, it cost me ICP, but i figured “hey that is the cost of sending proposals”.

Could I have started up a local version of the Governance Canister? I guess so, but i found it easier to do this for testing:

  1. Craft the message via the Candid UI of Governance Canister: DFINITY Canister Candid UI
  • this allowed me to type check the arguments and inputs even if it the message did not work for lack of authorization or neuron with ICP
  1. Once I was relatively certain of the arguments I wanted, I then sent a real proposal with a neuron that had a few ICP for me
  • Personally (and this is indicative of how early I was in the documentation process), the whole experience took me a few hours and cost me maybe 2 ICP.

(fwiw yes I actually did buy ICP on Coinbase in order to have a “start from scratch” experience and identify any pain points)

1 Like

@diegop unless I’m missing something, the title in step 1.2 ("… ensure the principals are the same") should be to ensure the account IDs are the same because $ dfx --identity proposals ledger account-id only returns the account ID, right?

1 Like

You may have figured this out in the last 25 days, but you can add a hot key to your NNS neuron and issue manage_neuron calls from it.

Yes you are right those only return account IDs. I must have meant “check accounts”. I need to do a review of the intent, but quick glance leads me to believe you are right.

1 Like

I believe this is correct, but I have not tested this.

Update: I am moving this to the wiki and cleaning up certain parts:

https://wiki.internetcomputer.org/wiki/How-To:_Create_an_NNS_motion_proposal

2 Likes

Update:

This page is much cleaner. Please use the wiki: How-To: Create an NNS motion proposal - Internet Computer Wiki

2 Likes

Keysmith was just deprecated, per the README - GitHub - dfinity/keysmith: Hierarchical Deterministic Key Derivation for the Internet Computer

Can you update the wiki to reflect this?

Yes will do. Good catch. That should make things simpler.

I would like to submit some suggestions, but have encountered some problems.

dfx --identity proposals canister --network ic --no-wallet call rrkah-fqaaa-aaaaa-aaaaq-cai manage_neuron '(record {id = null; command=opt variant {MakeProposal=record {url=""; title="$TITLE";action=opt variant {Motion=record {motion_text="$MOTION_TEXT"}}; summary="

$SUMMARY

"}}; neuron_id_or_subaccount=opt variant {NeuronId=record {id=$NEURON_ID:nat64}}})’

Here is the command to initiate a proposal using dfx.
I need to replace $SUMMARY with proposal content,But the proposals are multi-line, so I can’t enter them in one command. I can only use ‘\n’ to replace all newlines in the proposal. Is there any way to make it simpler

Hmmm I submit multi like proposals all the time by copy pasting from a markdown file. Would it help you if I paste the exact command I used?

dfx --identity proposals canister --network ic --no-wallet call rrkah-fqaaa-aaaaa-aaaaq-cai manage_neuron ‘(record {id = null; command=opt variant {MakeProposal=record {url=“https://medium.com/@ysyms/如何在nns发起动议提案-fca251185ab4”; title="$(title.md)";action=opt variant {Motion=record {motion_text="$(title.md)"}}; summary="$(proposals.md)"}}; neuron_id_or_subaccount=opt variant {NeuronId=record {id=16392997059792243989:nat64}}})’

how to use md file.I am not a developer

Ok, to help you I will post the EXACT command I used to create this motion proposal: https://dashboard.internetcomputer.org/proposal/50135.

I literally wrote this command in a file and then copied/pasted this on my terminal:

dfx --identity proposals canister --network ic call rrkah-fqaaa-aaaaa-aaaaq-cai manage_neuron '(record {id = null; command=opt variant {MakeProposal=record {url=""; title="Chain Key Bitcoin Ledger on the Internet Computer";action=opt variant {Motion=record {motion_text="Chain Key Bitcoin Ledger on the Internet Computer"}}; summary="
 
# Summary
 
The goal is to have a Bitcoin ledger that makes use of the Bitcoin integration on the IC to bring \"Chain Key Bitcoin\", referred to as ckBTC in this proposal, to the Internet Computer. Unlike standard \"wrapped\" Bitcoin solutions, this ledger will not depend on any bridge between the Bitcoin network and the Internet Computer.
 
If this functionality is built, it will be possible to exchange BTC for ckBTC and vice versa at a 1:1 rate as well as trade ckBTC at the speed of the Internet Computer.
 
To vote YES on this proposal means that you agree with the plan to build, launch, operate this functionality on the Internet Computer.
 
If this proposal fails, then this design will not be implemented and the community will go back to the drawing board.
 
## Key people involved
 
Manu Drijvers, Mario Pastorelli, Thomas Locher
 
Timeline for this community-wide design discussion
 
* 1-pager posted on the forum for review: February 3, 2022
* Draft plan for feature posted on the forum for review: March 15, 2022
* Community conversation with Mario Pastorelli and Thomas Locher: March 16, 2022
* NNS Proposal submission: March 17, 2022, 15:00 UTC
* NNS Proposal expiration: March 19, 2022, 15:00 UTC
 
If NNS Motion Proposal passes, implementation + deployment target: Q3 2022.
 
## Design doc for the community:
 
You can also view a summary of the design here: [Proposed design to review and vote on](https://forum.dfinity.org/t/feedback-wanted-wrapped-bitcoin-ledger-on-the-internet-computer/10681/66?u=thlo).
 
# NNS Proposal: Chain Key Bitcoin Ledger on the Internet Computer
 
# Objective
 
The goal is to introduce a Bitcoin ledger on the Internet Computer based on the Bitcoin integration feature and Chain Key technology.
 
While the name is not set in stone, we call it the Chain Key Bitcoin (ckBTC) ledger in this design because it is one of the proposed names that received mostly positive feedback.
 
The ledger will make it possible to trade ckBTC at the speed of the Internet Computer at low cost. Moreover, it will offer mechanisms to convert BTC to ckBTC and vice versa, at a 1:1 rate. Thus, the Chain Key Bitcoin Ledger complements the Bitcoin integration functionality, simplifying the use of Bitcoin on the IC.
 
# 1. Proposal
 
## Design
 
The ckBTC functionality is introduced in the form of two new canisters:
 
* The ckBTC Ledger is an instance of a ledger, handling ckBTC transfers and managing account balances.
* The ckBTC Minter holds all Bitcoin of ckBTC holders and is in charge of issuing mint and burn calls to the ckBTC Ledger.
 
### ckBTC Ledger
 
The API of the ckBTC Ledger will be specified at a later stage. It will offer functions to query balances and transfer funds.
 
### ckBTC Minter
 
The ckBTC Minter will offer the following functions.
 
`get_btc_address(subaccount: vec nat8) -> (String);`
 
The function deterministically computes a Bitcoin address based on the ckBTC Minter’s main Bitcoin address and the caller’s principal ID, which is an implicit parameter of the function, and the provided subaccount.
 
Specifically, starting from the ckBTC Minter’s default key, BIP-32 key derivation is used to derive a key using the caller’s principal ID and the provided subaccount. The returned address is derived from this key.
 
Note that it is possible for a user to derive this Bitcoin address herself/himself.
 
`get_withdrawal_account() -> (AccountIdentifier);`
 
The function deterministically computes a ckBTC Ledger account ID based on the principal ID of ckBTC Minter and the principal ID of the caller. The ckBTC Minter burns the ckBTC transferred to this account when the owner calls retrieve_btc to retrieve the same amount in bitcoin.
 
`update_balance(subaccount: vec nat8) -> (UpdateBalanceResult);`
 
The function instructs the ckBTC Minter to update the ckBTC balance of the caller. Specifically, the ckBTC canister checks if there are new UTXOs associated with the Bitcoin address derived from the caller’s principal ID and the provided subaccount. If there are such UTXOs, the equivalent amount is minted in ckBTC and made available to the caller in the given subaccount.
 
This function must be invoked after sending bitcoin to the ckBTC Minter because the ckBTC Minter cannot know for which derived accounts it will receive funds.
 
`retrieve_btc(amount: Bitcoin, fee: opt Bitcoin, address: String) -> (RetrieveBtcResult);`
 
The function instructs the ckBTC Minter to send the given amount of Bitcoin to the provided Bitcoin address, burning the equivalent amount of ckBTC tokens. Note that at least the given amount must be transferred first, in ckBTC, to the caller’s withdrawal account. The withdrawal account is a ckBTC Ledger account under the control of the ckBTC Minter. The subaccount is derived deterministically from the user’s principal ID.
 
The optional fee parameter defines the fee to be used in the Bitcoin transaction that transfers the Bitcoin to the given Bitcoin address. If no fee is provided, the ckBTC Minter uses a standard fee, obtained through the Bitcoin integration fee API.
 
The ckBTC tokens are burned before the Bitcoin transaction is confirmed. If a transaction does not appear in a block, the user has the option to resubmit the transaction using the resubmit_retrieve_btc function below.
 
`get_minimum_fee() -> (Bitcoin) query;`
 
The function returns the minimum expected fee when providing a custom fee in the retrieve_btc function call.
 
The ckBTC Minter uses the Bitcoin integration fee API to derive this fee.
 
`resubmit_retrieve_btc(request_id: nat64, new_fee: Bitcoin) -> (ResubmitRetrieveBtcResult);`
 
The function instructs the ckBTC Minter to resubmit a Bitcoin transaction for a previous request, updating the fee. This function is intended to be used for transactions that are stuck because the fee was set too low.
 
The new fee must be higher than the last fee in the transaction associated with this request, increasing the fee according to [BIP-125](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki).
 
# 2. Risks
 
If the ckBTC Minter or ckBTC Ledger is compromised, the funds provided in Bitcoin could be lost. The current plan is to deploy both canisters on a large system subnet, similar in size to the NNS, to mitigate this risk.
 
# 3. Alternative Designs
 
An alternative design would be to have a single canister acting as the ledger and custodian. Since we have a well-tested ledger available, having two separate canisters is considered to be a safer design. Moreover, reusing the existing ledger reduces the implementation effort.
 
# 4. Roll-out Plan
 
Once implementation and testing work has been completed, the plan is to deploy the two canisters to a system subnet, at which point the functionality becomes available.
 
If the ckBTC functionality is observed to behave as intended, the controller will be changed to the NNS, ensuring that any future changes can only happen with the approval of the community.
 
# 5. Timeline
 
If the NNS motion proposal is accepted, development will start right away. Proper testing will only be possible once the Bitcoin integration feature is operational. As a result, we plan to release the ckBTC functionality in Q3 2022.
 
# What we are asking the community
 
- Vote YES or NO on the proposal
 
Previous threads:
* https://forum.dfinity.org/t/feedback-wanted-wrapped-bitcoin-ledger-on-the-internet-computer/10681/66?u=thlo
 
"}}; neuron_id_or_subaccount=opt variant {NeuronId=record {id=9218890096040352708:nat64}}})'

2 Likes

thanks, it looks like it’s working. I was unable to execute because the special symbols were not escaped before, sorry

I thought this too, but apparently not. quill might still be a better tool for this particular task though.